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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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

Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Study of Characters
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education