Question: Exercise 1: Based on the following UML: Create the Java class. Use a test program to create three objects of type City: cityl: Paris /

 Exercise 1: Based on the following UML: Create the Java class.

Exercise 1: Based on the following UML: Create the Java class. Use a test program to create three objects of type City: cityl: Paris / 2141000 of population /105.4 km city2: London / 8136000 of population/1572 km city3: no details (call default constructor) Update "city3 to: Tokyo /9273000 of population/2188 km. Compare between the cities, then find and print the details of the smallest city in area. Afterward, find and print the details of the biggest city in population. Call peoplePerKM2 to find the number of people per km for each city, and then print the result. City - name: String - population: int - area: double + City 0 + City (String, int, double) + setName(String): void + getName(): String + set Population(int): void + get Population(): int + setArea(double): void + getArea(): double + peoplePerKM20): int + toString(): String

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 Databases Questions!