Question: Create the classes depicted in the UML. Ensure all methods and altributes are implemented and have the same spelling. The cost of the car is

Create the classes depicted in the UML. Ensure all methods and altributes are implemented and have the same spelling. The cost of the car is calculated as follows:
Cost of car = ccRating * numDoors *100
Create a Driver to test the implementation of your classes as follows:
2. Create two cars with the following information: cart -4 doors, Toyota, Camry, engine#: 104657 and 1300cc. car2-5 doors, Mitsubishi, Highlander, engine#: 34567 and 4000 cc . Display the info for the two cars
3. Create a third car car3 using your own data. Display the info for car3.
4. Create a car4 using the default constructor.
5. Update the information of car4 as follows: 3 doors, Bird, Canary, engine #.123455 and 30000.
6. What is the cost for car3? Modify your Car class by providing an accessor called getCost() to allow you to retrieve the cost of the car and display it. You should only introduce an accessor to solve this problem.
Car
-numDoors: int
-make: string
-model string
-engine: Engine
-calCost0: int
+CarO
+Car(int, string, string. int, int)
Car(Car)
+sethfo(int, string, string)
*updateCar(int, string, string)
tupdateEngine (int, im)
displayCar!
Engine
anginturimint
-eerating:int
+Engme 0
tengine(hin (m)
tgetecratingo int
*showligine 0
Create the classes depicted in the UML. Ensure

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!