Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi, can you help me with this C++ question? Need to create a class called FleetManager and follow instructions below. Will rate! Thanks. ####################################### car.cpp
Hi, can you help me with this C++ question? Need to create a class called "FleetManager" and follow instructions below. Will rate! Thanks.
####################################### car.cpp ####################################### #include #include "car.hpp" using namespace std; Car::Car(const char * m, Date * fDate, int mAge, const char * id, int pCapacity):Vehicle(m, fDate, mAge, id){ passengerCapacity = pCapacity; } Car::~Car(){ } int Car::getCapacity(){ return passengerCapacity; } void Car::print(){ Vehicle::print(); cout name = name; this->license = license; this->dob = dob; } string Customer::getName() { return name; } string Customer::getLicense() { return license; } Date* Customer::getDob() { return dob; } void Customer::printDetails() { cout printDetails(); CashPayment cashPay; VehicleRentalContract contract(req, &car, NULL, &cashPay, NULL, true); contract.print(); return 0; } ####################################### payment.cpp ####################################### #include "payment.hpp" Payment::Payment() : amountOfPayment(0) { // deliberately empty } Payment::Payment(float pAmountOfPayment) : amountOfPayment(pAmountOfPayment) { // deliberately empty } float Payment::getAmountOfPayment() { return amountOfPayment; } void Payment::setAmountOfPayment(float pAmountOfPayment) { amountOfPayment = pAmountOfPayment; } void Payment::paymentDetails() { cout getName() getDay() getMonth() getYear()getDay() getMonth() getYear()getDay() getMonth() getYear()reservationRequest = m; this->reservedCar = car; this->reservedTruck = truck; this->cashPayment = cashPayment; this->creditCardPayment = creditCardPayment; this->vehiclePicked = isPicked; } VehicleRentalContract::~VehicleRentalContract() { } bool VehicleRentalContract::isVehiclePicked() { return vehiclePicked; } void VehicleRentalContract::print() { cout printDetails(); if(reservedCar != NULL) { cout print(); } else if(reservedTruck != NULL) { cout print(); } if(cashPayment != NULL) { cout Please use C++ Below are classes to manage a fleet of a vehicle rental agency. Your job is to create a class called FleetManager. For this class, include one or more constructors, destructor and the necessary set and get functions. Also, provide a print function which outputs all the data members of that class. Make a cpp and hpp file for this class and update The class FleetManager should have the following data members A variable carfleet size that specifies the number of cars in the fleet A variable truckfleet_size that specifies the number of trucks in the fleet. . Collection of cars in the fleet, may be an array of car objects Collections of trucks in the fleet, may be an array of truck objects. Collection of customers, may be an array of customer objects. NOTE: At least the following additional member functions should be provided: - A member function that processes a reservation request received as a parameter. If reservation is successful it should return reservation request number otherwise zero. The reserved vehicle should have the closest capacity larger than the requested capacity. If reservation is successful a car rental object should be created and stored in the array of CarRentalContract A member function that receives a reservation request number as a parameter and outputs the details of the related car rental contract object. A member function that receives a reservation request number and current date as parameters and cancels reservation request. A member function that processes the returned vehicles which has the request reservation number and new mileage of the vehicle as parameters. IMPORTANT: Update the main function, where you should create customer objects and reservation requests objects. It should call to the FleetManager member functions to process all rental tasks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started