Problem

Population Database Make sure you have downloaded the book’s source code from th...

Population Database

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 fi nd 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:

Population Database

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 fi nd 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.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT