Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using c++ only 1 to 6 Building Person carExp Car 1 4) Write the header on (carExp.h) file and the implementation on (carExpImp.cpp) file of
using c++ only 1 to 6
Building Person carExp Car 1 4) Write the header on (carExp.h) file and the implementation on (carExpImp.cpp) file of the new class carExp which publically inherits the properties of the Building class with the following additional members as shown in the below UML class diagram. carExp -name: string -maxNumOfCars int -numOfCars: int -c*: Car + owner: Person + carExp (string, int, double, string, string, int,char, string, int) + carExp (carExp) + scarExp() + getMaxNumOfCars(): int + getNumofCars(): int + isFull(): bool + isEmpty(): bool + insertCar(string, string, int, double): void + printAllCars():void + allCarsPrices(): double + searchCarPrice (double): void + printInfo() : void Functions Description for carExp: 1) A constructor that takes 9 parameters and sets them to the following members: the address, the numOfFloors and the area for the building, the name, the nationality, the age and the gender for the owner and the name and the maxNumOfCars for the car exhibition. Also, it sets the numOfCars to zero (length). Then, builds a dynamic array of size maxNumOfCars of type Car by using the c pointer. 2) carExp(carExp &):a copy constructor to avoid shallow copying 3) carExp0): Destructor will delete the dynamic array and print the following statement "The car exhibition is closed". 4) getMaxNumOfCars9: return the maximum number of cars in the exhibition. 5) getNumOfCars: return the number of cars in the c array. Car 6) isEmptyO: return true if the car list has no elements else return false 7) isFullo:return true if the car list is full else return false 8) insert(string.stringint double): a void function that inserts a new car to the list. (Remember that you can't insert if the car list is full). 9) printAllCars: a void function to print all information about the car with the following format. Type Color Year Price Toyota BMW Ferrari Black Silver Red 2010 2012 2011 13000JD 30000JD 50000JD 10 allCars Prices(): a function that computes and returns the summation of all prices for all cars in the exhibition. r L 11)searchCarPrice(double): a void function that prints all information for all cars that have a price less than the parameter value. 12)printInfo: a void function that prints all information for the car exhibition. Exipition name: Just Address: Amman Number of floors: 3 Area: 5882 Owner Name: Amr Owner Nationality: Jordinian Owner Age: 50 Owner Gender: M Number of cars in this exipition: 3 Type Color Year Price Toyota BMW Ferrari Black Silver Red 2010 2012 2011 13080JD 30e8eJD 50000JDStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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