A used car dealership maintains an inventory

Assignment Help C/C++ Programming
Reference no: EM13164587

This is a multi-part problem in which you will construct several object classes and a short demonstration
program1
. Submit the completed program (all 4 parts) including all class definitions/implementations in a
single .cpp source file (i.e., do not construct separate files for class headers and implementation).

A used car dealership maintains an inventory of several types and models of vehicles. There are three kinds of
vehicles: Cars, Trucks and SUVs. Regardless the type, the dealership maintains the following information for
every vehicle:
• Make : string
• Model : string
• Year : integer
• Mileage : integer

Additional information is maintained for each individual vehicle depending on its type:
For Cars: Number of doors (2 or 4)
For Trucks: Drive type (2-wheel drive or 4-wheel drive)
For SUVs: Passenger Capacity


Part 1
Construct a base class named Vehicle to maintain the common vehicle data. The class should include a
constructor that will support initializing all 4 attributes as well as separate accessor and mutator methods for
each data attribute.


Part 2
Construct three additional classes named Car, Truck and SUV to represent Cars, Trucks, and SUVs
respectively. Each of these classes should be derived from the Vehicle class and extended by adding the
attributes unique to the type of vehicle. Each class should provide a constructor to initialize its attribute(s) as
well as the attributes of the parent class. Provide accessor and mutator methods for each class to get and set the
attributes for the particular class.

Add a method named Display to each of the four classes to print out the individual vehicle information. For
the Vehicle class, the Display method should print the following (one element per line):
Make: vehicle_make
Year: vehicle_year
Model: vehicle_model
Miles: vehicle_mileage

Each vehicle-type class (Car, Truck, SUV) should print out the information specific to its own type in addition
to the vehicle information. Note that you can print the vehicle information using a call to the base class
Display method: Vehicle::Display(). Here is an example of the output for a Car:
Inventory unit: Car
Make: Audi
Year: 2009
Model: A8
Miles: 40000
Number of doors: 4


Part 4
Finally, write a main program to test your classes. Instantiate 5 objects to represent the following vehicles:

car: 1987 Audi A6 4-door with 185,000 miles
car: 1963 Volkswagen Beetle 2-door with 240,000 miles
truck: 2007 Ford 4-wheel drive F-150 with 82,000 miles
suv: 2001 8-passenger Chevrolet Suburban with 118,000 miles
suv: 2010 5-passenger Kia Sorento with 29,000 miles

Print out the vehicle information for all 5 vehicles using the .Display() method for each vehicle.

Reference no: EM13164587

Questions Cloud

Using quicksort with median-of-three : Show the steps in details of sorting {3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5} using quicksort with median-of-three partitioning and a cutoff 3 (if the elements are less than 3, using insertion sort).
Enter the temperature at noon of each of the five days : Write a program that allows each employee to enter the temperature at noon of each of the five days and displays the highest, lowest, and average (mean) temps.
Braces for blocks of code : C-- should have braces for blocks of code, an if statement, while statement, and a double, int, and character. Each statement ends with a semi-colon and you must have a main routine
Allows you to enter 10 phonecalls into an array : Create a main() function that allows you to enter 10 PhoneCalls into an array. If a PhoneCall is already been placed to a number, do not allow a second PhoneCall to the same number
A used car dealership maintains an inventory : Submit the completed program (all 4 parts) including all class definitions/implementations in a single .cpp source file (i.e., do not construct separate files for class headers and implementation).
Using java, design and implement an api euclidean graph : Using Java, design and implement an API EuclideanGraph for graphs whose vertices are points in the plane that include coordinates.
The class constructor should accept an array : Write a class named TestScores. The class constructor should accept an array of test scores as its arguments. The class should have a method that returns the average of the test scores. If any test score in the array is negative or greater than 10..
Opens an output file with the external name : Design an algorithm that does the following: opens an output file with the external name number_list.dat, uses a loop to write the numbers 1 through 100 to the file and then closes the file.
Devise a linear-time algorithm to count the parallel edges : Parallel edge detection: Devise a linear-time algorithm to count the parallel edges in a graph. Write the algorithm in pseudo-code.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd