Homework 3
Course:
Given the Car example from Homework 1, write a class Application that contains a main() method to do the following statements in the given order:
- Create an Car object car1 name “speed”, id "1", 5 seats, year 2010 that contains the following car elements:
- CarElement engine: id: “1”, price: 25000.00
- CarElement chassis : id: “2”, price: 15000.00
- CarElement tires: id:"3", price 10000.00
- CarElement glass: id"4", price 5000.00
- Create an Car object car2 name “maxSpeed”, id "2", 2 seats, year 2013 that contains the following car elements:
- CarElement engine: id: “11”, price: 35000.00
- CarElement turbo: id:"XX", price: 30000.00
- CarElement chassis : id: “22”, price: 15000.00
- CarElement tires: id:"33", price 20000.00
- CarElement glass: id"44", price 5000.00
- Create a Car object car3 name “speed2”, id "3", 5 seats, year 2011 that contains the following car elements:
- CarElement engine: id: “111”, price: 20000.00
- CarElement chassis : id: “222”, price: 10000.00
- CarElement tires: id:"333", price 5000.00
- CarElement glass: id"444", price 2500.00
- Display the price of the each car
- Create a KSUCars ksuSpeedCars with nbc = 10
- Add any of the cars created to ksuSpeedCars if they are full size.
- If ksuSpeedCars is not empty then print the average price of the its cars
Zip the entire project with all the object classes and the class Application and send the zip file to aelallali@ksu.edu.sa
Unzipped files or files with wrong extension receive 10 points deduction.
Homework is due Sunday Novemeber 24th at 12 pm. ABSOLUTLY NO EXTENSION!!!
