Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Car name : string -id:string -seatNb : int |-year: int -ncel : int +Carrin n string, in d: string, in sint, in y:int, in size

image text in transcribed
image text in transcribed
image text in transcribed
Car name : string -id:string -seatNb : int |-year: int -ncel : int +Carrin n string, in d: string, in sint, in y:int, in size : int) +display +isFull(): bool +copyCar(in ca: Car) +addElement(in el: CarElements): bool +PriceCar(): double CarElements -code: string -price: double +CarElements (in c: string, in p: double) +CarElement(in E: CarElements) +display() . KsuCars -nbc : int +KsuCars(in size : int) +display) +isEmpty(): bool +searchCar(in ce : string): int +getCar(in nm : string): Car +Average Price(iny:int)double +..............) +remove(ins: string): bool Question: Implement all the classes with all their methods using the following descriptions. Description of the different classes: Class CarElements: The method display () displays the code and the price. + ........ (in ........) : if you need an other methods in this class you can add it. You can't add another constructor. Class Car: name id seatNb : Number of seats year : Production year of car And other attribute(s) deduced from the UML diagram. display 0): Displays all the attributes of an object Car. .addElement (CarElements el): This method receives a CarElements object and adds it to the Car object. priceCar(): Returns the sum of the CarElements price in an object of the class Car. + ......... (in ........): if you need an other methods in this ) class you can add it. Class KsuCars: And other attribute(s) deduced from the UML diagram. display (): Displays all the attributes of an object KsuCars. search (String ce): This method receives a String representing the name of a Car object and returns the array index of the car object. getCar (String nm): This method receives a String representing the id of a Car object and returns the Car object if it's exist. removeCar (String s): Removes a Car according to its name. It will return a value true if the operation has been completed successfully, or false if not. AveragePrice(int y): Calculates the average price of all car in an object of class KsuCars that produced after the year y. + (in ........): if you need an other methods in this class you can add it. The main class: In the main you should be able to create a KsuCars with at least 3 cars. Each car has at least 4 car element. A display should be called to see all the entered data

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

Students also viewed these Databases questions

Question

=+ Are unions company-wide, regional, or national?

Answered: 1 week ago

Question

=+j Explain the litigation risks in international labor relations.

Answered: 1 week ago