Question: Make sure you have downloaded the books source code from the companion Web site at www.pearsonhighered.com/gaddis. In this chapters source code folder you will find
Make sure you have downloaded the book’s source code from the companion Web site at www.pearsonhighered.com/gaddis. In this chapter’s source code folder you will find a program named CreateCityDB.java. Compile and run the program. The program will create a Java DB database named CityDB. The CityDB database will have a table named City, with the following columns:

The CityName column stores the name of a city and the Population column stores the population of that city. After you run the CreateCityDB.java program, the City table will contain 20 rows with various cities and their populations.
Next, write a program that connects to the CityDB database, and allows the user to select any of the following operations:
• Sort the list of cities by population, in ascending order.
• Sort the list of cities by population, in descending order.
• Sort the list of cities by name.
• Get the total population of all the cities.
• Get the average population of all the cities.
• Get the highest population.
• Get the lowest population.
Column Name CityName Primary key Population Data Type CHAR (50) DOUBLE
Step by Step Solution
3.42 Rating (168 Votes )
There are 3 Steps involved in it
A program that connects to the CityDB database and allows the user to select any of the above operat... View full answer
Get step-by-step solutions from verified subject matter experts
