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

  Develop a program that when you pipe in a file

develop a program that when you pipe in a file it will demonstrate on the left had side the line number  work by having a program piped in and when a \n occurs a new line and number is indicated.

  Find the pairs in any given matrix

write a c program which will find the pairs in any given matrix, whose sum of pairs are 10.

  Calculate that implements a simple arithmetic calculator

Write a  C program  calc.c that implements a simple arithmetic calculator. Input to the calculator consists of lines composed of integer constants separated by the five arithmetic operators used in C: +, -, *, /, and %. For each line of input,

  Main function to input twenty integers in given range

Write a main function to input 20 integers in range of 1-6, function should count number of times the numbers 2 and 5 occur. function must declare statics variables count2 and count5.

  Write a c program which takes a string from command line

Write a c program which takes a string from command line with mainfunction has no parameter and convert the string in upperca

  Implementation of classes

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

  Write a recursive and iterative versions of binary search

in C++ write a recursive and iterative versions of binary search and compare their run times using the array a[i]=i, i=0,..., n-1

  Create program to input miles driven and gallons used

Create a program in C++ which will input miles driven and gallons used (both as integers) for each tankful. Program must compute and display the miles per gallon

  Illustrate example from ansi c programming language

Illustrate example from ANSI C programming language, without using nested procedures, to show the fact that "assignment-by-sharing in conjunction with quasi-dynamic object binding

  Create a base employee class

Create a base Employee class and a derived StudentEmployee class

  Write recursive boolean method to accept array and value

Write down the recursive boolean method named isMember. The method must accept two arguments: an array and a value. Method must return true if value is found in array.

  Recognition of the problem by the hsbc

What problem did the HSBC face in this case? What people, technology, and the organization factors were responsible for problem? Did HSBC management correctly recognize the problem?

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