Question: Java Class - Vehicle Create a class named Vehicle. Define private string variables for the vehicle s color, make, and model. Define a private integer
Java
Class Vehicle
Create a class named Vehicle. Define private string variables for the vehicles color, make, and model. Define a private integer variable for the number of doors. Define private double variables for the discount and price.
Constructors:
Implement a copy constructor that takes a Vehicle object as a parameter and initializes the fields accordingly.
Implement a constructor that accepts all private fields and assigns them using the this keyword.
Create a noargument constructor that initializes all fields to default values.
Methods:
Implement necessary accessor and mutator methods.
Implement a method to calculate the total price after applying the discount.
Override the toString method to provide a userfriendly representation of the vehicle.
Class Customer
Create a class named Customer. Define private string variables for name, city, and state.
Methods:
Implement necessary accessor and mutator methods.
Override the toString method for userfriendly output.
Class CarDealership
Create an aggregate class that utilizes the Vehicle and Customer classes. Define private string fields for the store name and location. Implement private ArrayList
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
