Please written by computer source What will the application do? Display a set of at least 6 cars (at least 3 new and 3 used) along with Add and Quit options Let the user select one of the cars. Ask if they want to buy the car. If they enter yes, remove it from the list. If they want to add another car to the list, get the details, create a new instance of the appropriate class (Car class for new cars, or UsedCar), and add it to your data collection. Keep looping until they choose to quit. Build Specifications If your instructors tells you to work in pairs, stay with your assigned pair for this lab. Create a class named Car to store the data about a car. This class should contain:Data members for car details A string for the make A string for the model An int for the year A decimal for the price A no-arguments constructor that sets data members to default values (blanks or your choice) A constructor with four arguments matching the order above Properties for all data members An override to the ToString() method returning a formatted string with the car details. Create a subclass of Car named UsedCar. UsedCar has additional members: Data member: A double for mileage. Constructor: Takes five arguments (same order as constructor from last lab with the mileage last). ToString: overrides Car’s ToString() to include (Used) and the mileage. Discuss with your partner how to store the car information. In what cases would each of these make more sense (if at all)? A variable that’s a two-dimensional array of cars A variable that’s a List A variable that’s a Dictionary Any other option? However you store the information, you should include methods to Add a car List all cars to the console Remove a car
Please written by computer source
What will the application do?
Display a set of at least 6 cars (at least 3 new and 3 used) along with Add and Quit options
Let the user select one of the cars.
Ask if they want to buy the car. If they enter yes, remove it from the list.
If they want to add another car to the list, get the details, create a new instance of the appropriate class (Car class for new cars, or UsedCar), and add it to your data collection.
Keep looping until they choose to quit.
Build Specifications
If your instructors tells you to work in pairs, stay with your assigned pair for this lab.
Create a class named Car to store the data about a car. This class should contain:Data members for car details
A string for the make
A string for the model
An int for the year
A decimal for the price
A no-arguments constructor that sets data members to default values (blanks or your choice)
A constructor with four arguments matching the order above
Properties for all data members
An override to the ToString() method returning a formatted string with the car details.
Create a subclass of Car named UsedCar. UsedCar has additional members:
Data member: A double for mileage.
Constructor: Takes five arguments (same order as constructor from last lab with the mileage last).
ToString: overrides Car’s ToString() to include (Used) and the mileage.
Discuss with your partner how to store the car information. In what cases would each of these make more sense (if at all)?
A variable that’s a two-dimensional array of cars
A variable that’s a List<Car>
A variable that’s a Dictionary <?, Car>
Any other option?
However you store the information, you should include methods to
Add a car
List all cars to the console
Remove a car

Step by step
Solved in 4 steps with 5 images









