Write a program that reads in a list of names and ages until the user enters "quit" as a person’s name. When the sentinel (quit) appears as the name, your program should display the name of the oldest person in the list and then terminate. For example, with the list of entries
the program will print
The oldest person is Kathy.
Jump to Post
Did you try to do this with pseudocode to see what the operations are? The folowing pseudocode should help you with how you need to write the program.
number age = 0, max = 0; string name, oldest while(true) get name if name == "quit" break get age if …
All 4 Replies
We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.