Question: Consider the following program that allows a user to print the age of the Nth oldest known person to have ever lived. Note: The ages

Consider the following program that allows a user to print the age of the Nth oldest known person to have ever lived. Note: The ages are in a list sorted from oldest to youngest.
1. Modify the program to print the correct ordinal number ("1st","2nd","3rd","4th", or "5th") instead of "1th","2th","3th","4th", or "5th".
2. For the oldest person, remove the ordinal number (1st) from the print statement to say, "The oldest person lived 122 years".
Reminder: List indices begin at 0, not 1, thus the print statement uses oldest_people[nth_person-1], to access the nth_person element (element 1 at index 0, element 2 at index 1, etc.).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!