Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions