Question: Only consider the programme code given above and the comment information, answer the following questions. a) Draw the UML class diagram, only related to the


Only consider the programme code given above and the comment information, answer the following questions. a) Draw the UML class diagram, only related to the given program code above. b) To complete the given constructor, write only two statements for the body of this given constructor, which: assigns the field of city name with the value of the right input parameter using assignment operator, and then sets the field of population with the value of the right input parameter using proper method, without using assignment operator. = public class City { // modelling City protected String cN; // name of city private int cP; // population of city static final int P_BIGCITY 3;//bigcity population: 3 million City (String cn, int cp) // TO BE COMPLETED } public void setCP(int p) { CP = p; } int getCP() { return cP; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
