Question: 1. Write a constructor for the Car class that will accept two input arguments as the initial values of the attributes. 2. Write an overloaded
1. Write a constructor for the Car class that will accept two input arguments as the initial values of the attributes.
2. Write an overloaded constructor for the Car class that will take a single argument for the model of the car, setting the make to "unknown".
3. Write a setter method for the make attribute.
4. Write a getter method for the model attribute.
5. Complete a main method that will accomplish the following steps. (You may assume that the class includes all appropriate setter methods and getter methods for all instance variables.) Create a car with the make "Ford" and the model "Fusion". Create a car with the make "Honda" and the model "Civic". Change the model of the second car from "Civic" to "Accord". On a separate line, print the make and model values for each car.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
