Population Database You will find a program named CreateCityDB.java in Starting Out with Java: Early Objects (6th Edition) Chapter 15 Source Code. Compile and run the program (SEE BELOW). The program will create a Java DB database named CityDB. The CityDB database will have a table named City, with the following columns: Column Name Data Type CityName CHAR (50) Primary Key Population DOUBLE 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 JavaFX application called PopulationDemo that connects to the CityDB database and allows the user to click 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.
Population
You will find a program named CreateCityDB.java in Starting Out with Java: Early Objects (6th Edition) Chapter 15 Source Code. Compile and run the program (SEE BELOW). The program will create a Java DB database named CityDB. The CityDB database will have a table named City, with the following columns:
Column Name | Data Type |
---|---|
CityName | CHAR (50) Primary Key |
Population | DOUBLE |
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 JavaFX application called PopulationDemo that connects to the CityDB database and allows the user to click 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.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
How do you display the data in a JavaFX application?