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

  Program to compute diameter in centimeters of a steel rod

Write a program to compute the diameter in centimeters of a steel rod, an aluminum rod, and a copper rod, which can withstand a particular compression load.

  Write program which reads n numbers from keyboard

Write down C++ program which reads N numbers (positive, negative, integer and double numbers) from keyboard, computes and shows the following information. Largest number of all numbers entered from keyboard.

  Write a program that accepts as input, without prompts

Write a program that accepts as input, without prompts, a series of short values, terminated by end of file. The program outputs one line:

  Perform operations on arrays

Perform operations on arrays execute tests and repetitions

  Stores a series of numbers in a binary tree.

Queue Converter, Write a program that stores a series of numbers in a binary tree. Then have the program insert the values into a queue in ascending order. Dequeue the values and display them on the screen to confirm that they were stored in the prop..

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Determine order in which constructors of class will execute

Suppose that an object of class three enters its scope, so the constructors of theses classes will execute. Determine the order in which the constructors of these classes will execute.

  Create a program for a company named retail-mart

Prompt the user to enter an item name (one word only), a quantity and a price. For this step, in addition to functionality, I'll be looking at: location of the variable declarations; appropriateness of data types selected; appropriateness of the va..

  Programming assignment is to tweak the existing mammal

programming assignment is to tweak the existing Mammal program and create your own Vehicle program.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  In c++, write a program that calculates 10,000 tries.

In C++, write a program that calculates 10,000 tries. These tries are based upon a rat trying to escape from a maze. Keep adding minutes until the rat is free and when he is free that is 1 try so we need 10,000. We start by randomly generating a numb..

  Program that stores a series of numbers in a binary tree

Write a program that stores a series of numbers in a binary tree

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