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

  Use selection sort to sort a[48] into increasing order

Use selection sort to sort A[48] into increasing order, and then print out the sorted list in four rows. There may be duplicates, but that's OK. (65 and 53 appear twice.) Duplicates will appear next to each other in the sorted list.

  Write program to count occurrences of each word in text

Write down C++ program to read following text. Count occurrences of each word in text and keep this count in list of elements containing (word, occurrence count) pairs.

  Attribute information about an array of floating point

Write a program that contains a main function and three other functions that will return various attribute information about an array of floating point

  Afunction that raises an integer to a positive integer

Write a function that raises an integer to a positive integer power. Call the function x_to_the_n, taking two integer arguments x and n.

  Write the class definition for a class called complex

. Write the class definition for a class called complex.

  Write program to declare the array of type float

Write down the c++ program which declares the array of 50 components of type float. Initialize array so that first 25 components are equal to square of the index variable.

  A series of one-digit non-negative numbers

Write a program that asks the user to enter a series of one-digit non-negative numbers

  Program that stores a series of numbers in a binary tree

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

  Program to print out invalid number to character

The integer must contain 3 distinct non-zero number, or the program will print out invalid number.it should print out invalid query.

  Program to store lists of names and ages in parallel arrays

Write a C++ program that stores lists of names (the last name first) and ages in parallel arrays and sorts the names into alphabetical order keeping the ages with the correct names.

  Program to produce ten random permutations of numbers

In C++(must be able to compile in Visual Studio ): Write a program to produce ten random permutations of numbers 1 to 10.

  Write a programme on credit card number check

Credit Card Number Check. The last digit of a credit card number is the check digit, which protects againsttranscription errors such as an error in a single digit or switching two digits

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