Question: Create a program that allows the user to enter city names until they enter XXX. The program will then sort the names in descending
Create a program that allows the user to enter city names until they enter "XXX". The program will then sort the names in descending order and display the sorted list of names. Start with an empty list. Program 2 requirements: The program must utilize a sentinel controlled while loop The program must store the entered names in a list The program must sort the array in descending order (Z - A). Sample run and output: . . . Enter City Name: Brownsville Enter City Name: Abeline Enter City Name: Waco Enter City Name: Austin Enter City Name: El Paso Enter City Name: Dallas Enter City Name: XXX Sorted Cities (descending): Waco El Paso
Step by Step Solution
There are 3 Steps involved in it
GDB mainpy 1 Initialize an empty List to store city names 2 citynames 3 Use a sent... View full answer
Get step-by-step solutions from verified subject matter experts
