Question: Pls solution using C programming language .............................. c++ code #include #include using namespace std; #define NC 3 #define NT 2 class Vehicle { string reg_no;

Pls solution using C programming language
..............................
c++ code
#include#include using namespace std; #define NC 3 #define NT 2 class Vehicle { string reg_no; double rate; int avail; public: Vehicle() { reg_no="1111"; rate=500; avail=1; } void set_rate(double r) { rate=r; } double get_rate() { return rate; } void set_reg(string reg) { reg_no=reg; } string get_reg() { return reg_no; } void set_avail(int t) { avail=t; } int get_avail() { return avail; } }; class Car:public Vehicle { string name; int year; public: Car() { Vehicle(); name="Honda"; year=2000; } Car(string na,int yr) { name=name; year=year; } int get_year() { return year; } string get_name() { return name; } }; class Truck:public Vehicle { string name; int year; public: Truck() { Vehicle(); name="BT"; year=2000; } Truck(string na,int yr) { name=na; year=yr; } int get_year() { return year; } string get_name() { return name; } }; class Customer { string name; string address; int phone_no; public: Customer() { } Customer(string n,string adrs,int ph) { name=n; address=adrs; phone_no=ph; } }; class Rental_company { public: Car car[NC]; Truck truck[NT]; double amount; char* dt ; int typeofp; void displayVehicleRpt() { //Records of vehicle cout>i; i=i-1; car[i].set_avail(0); if(dys>=5) { dis=0.2; amt=car[i].get_rate()-(car[i].get_rate()*dis); } else amt=car[i].get_rate(); cout>i; i=i-1; truck[i].set_avail(0); if(dys>=5) { dis=0.2; amt= truck[i].get_rate()-(truck[i].get_rate()*dis); } else amt=truck[i].get_rate(); cout>tp; typeofp=tp; amount=amt; time_t now = time(0); // convert now to string form dt = ctime(&now); } }; int main() { int ch; int cort; // Rental_company obj1[100]; Rental_company obj; int r=0; do{ cout>ch; switch(ch) { case 1: obj.displayVehicleRpt(); break; case 2: obj.ListAvailVehicle(); break; case 3: cout>cort; int i,dy; cout>dy; obj.vehi_rental(cort,dy); break; /* case 4: int pm; for(int i=0;i Ibarahim is the manager of a rental company that has 30 cars and 20 trucks. He would like to have an application to manage the company's operation. The application should have the following basic functions: 1- Records of vehicles 2- Availability of a Vehicle 3- Rental of a vehicle 4- Different payment options Each customer record should also include the following: Name, Address, Phone Number, ... A vehicle rental is on a daily basis. A vehicle record includes a number of attributes among them: Registration number and rental rate. Each customer is illegible to have 20% discount for rental of 5 days or more. Customers may have a special discount up to 40% The following reports should be printed by the application: - Listing of rental records (Time Period) - Listing of available vehicle to be rented - Listing of payment types with amounts in a time period Using C programming language
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
