172k views
5 votes
Write an application that allows a user to enter the names and birth dates of up to 10 friends. Continue to prompt the user for names and birth-dates until the user enters the sentinel value “ZZZ” for a name or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names and display the corresponding birth-date or an error message if the name has not been previously entered. The loop continues until the user enters “ZZZ” for a name.

User Jaqueline
by
8.0k points

2 Answers

4 votes

Final answer:

The question is about programming an application to record and manage friends' names and birth dates, counting the entries and allowing for name-based lookup until terminated by the user.

Step-by-step explanation:

The question involves writing an application that manages a list of up to 10 friends' names and birth dates. The user is prompted to enter this information until they input 'ZZZ' as a sentinel value or reach the limit of 10 entries. Once data entry is complete, the application will count and display the names. The user is then invited to enter any of these names to retrieve the corresponding birth date, or receive an error message if the name is not in the list. This loop continues until 'ZZZ' is entered as a name again.

The application would likely use an array or list to store the friends' information, and a loop to handle the input and display process. To provide the functionality described, you would need to use data structures, conditional statements, loops and, potentially, exception handling for invalid input. The application should keep user engagement with a user-friendly interface and clear prompts.

User Dibzmania
by
8.3k points
4 votes
Sorry I don’t know the answer I am really sorry
User Nikki Locke
by
7.8k points