Question: 4 public class Car { 5 6 7 ** 8 * Instance variable for storing the type of the car */ private CarType type; 9

 4 public class Car { 5 6 7 ** 8 *Instance variable for storing the type of the car */ private CarType

4 public class Car { 5 6 7 ** 8 * Instance variable for storing the type of the car */ private CarType type; 9 10 ' 11 12 13 NA /** * Instance variable for storing the car plate number */ private String plateNum; 14 15 16 17 18 /** * @return the type of this car */ public CarType getType() { // WRITE YOUR CODE HERE! 19 20 21 22 return null; // REMOVE THIS STATEMENT AFTER IMPLEMENTING THIS METHOD 23 } 24 25 ** * Sets the type of the car * 26 27 28 29 30 31 * @param type is the car type */ public void setType(CarType type) { // WRITE YOUR CODE HERE! } 32 33 34 35 36 37 38 /** * @return the plate number */ public String getPlateNum() { // WRITE YOUR CODE HERE! return null; // REMOVE THIS STATEMENT AFTER IMPLEMENTING THIS METHOD } 39 40 41 42 43 44 /** * Sets the car plate number ** 45 46 47 * @param plateNum is the car plate number */ public void setPlateNum(String plateNum) { // WRITE YOUR CODE HERE! } 48 49 * Constructor for Car ** ** * @param type is the type of the car @param plateNum is the car plate number */ public Car(CarType type, String plateNum) { // WRITE YOUR CODE HERE! } 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 /** * Returns a string representation of the car */ public String toString() { // NOTE: The implementation of this method is complete. You do NOT need to // change it for the assignment. return Util.getLabelByCarType(type) + 'C' + plateNum + ')'; } }

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!