Case Study Car Dealership ABC Car Dealership needs your help to update the order
ID: 3538680 • Letter: C
Question
Case Study Car
Dealership
ABC Car Dealership needs your help to update the ordering system. This car dealer is selling
four types of vehicles: Sedan, Truck, SUV, and mini Van. And each type of vehicle can have
several options: sunroof, security, entertainment, and advanced safety feature. As each vehicle
can be equipped with none or more options, and even the same option (e.g. sunroof) can be
added twice to the same vehicle. The software needs to be able calculate the total price
accurately (base price + prices of installed options). You will need to design classes such that
the software can be easily maintained.
Before writing the actual client application (i.e. main()), be sure your classes should provide
enough interface functions that allow the complete client application to be written.
plz include following
1. Inheritance
2. Virtual functions
3. Constants and references
4. Constant methods
5. Copy constructors
6. Dynamic memory allocation
Explanation / Answer
#include<iostream>
using namespace std;
class Sedan()
{
int base=1000,a1,b2,c3,d3;
char a[10][10];
Sedan()
{
cout<<"Enter the parts u want to install and how many:";
cin>>a>>a1;
}
};
class SUV()
{
int base=2000;
char a[10][10];
SUV()
{
cout<<"Enter the parts u want to install and how many:";
cin>>a>>a1;
}
};
class Truck()
{
int base=3000;
char a[10][10];
Truck()
{
cout<<"Enter the parts u want to install and how many:";
cin>>a>>a1;
}
};
class MiniVan()
{
int base=500;
char a[10][10];
MiniVan()
{
cout<<"Enter the parts u want to install and how many:";
cin>>a>>a1;
}
};
int main()
{
int ch
cout<<"Enter the car: 1.Sedan 2.SUV 3.Truck 4.Mini van:
cin>>ch;
switch(ch)
{
case 1:Sedan s;
break;
case 2:SUV su;
break;
case 3:Truck t;
break;
case 4:MiniVan v;
break;
default:break;
}
return 0;
}