Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following UME, diagram Part 1: Implement the following classes Check the notes below before you start: Accident Report -date Date Vehicle Involvement Verdell

image text in transcribed
Given the following UME, diagram Part 1: Implement the following classes Check the notes below before you start: Accident Report -date Date Vehicle Involvement Verdell ownerString -bolehicle:int matriculation String - model: String Date Dute New Veidely Vehicle void Vehicle Parameters cruiserotoloved boolean Setters/petters .toString): String counttomatical Owner:void Motorcycle - torque double -type: String // standard, cruiser or sport + Motorcycle Parameters setter/Better *toString: String Car horsePowerint - automatic:boolean Car - Al Parameters settetpetter + toering Sering Notes: 1. The Vehicle class (10pts) The ToString method should refuma String similar to : Model: BMW. Owner: Ali Moussa, Matriculation: 51234 2. The car class (16pts) a The ToString method should retuma String similar to: Car BMW.Owner. Ali Moussa, Matriculation: 51234, Automatic 255 hp OR Car BMW.Owner. Ali Moussa Matriculation S1234. Manul 255 hp 3. The motorcycle class (16pts) The toString method should retum a String similar to Sport Motorcycle: BMW.Owner. Ali Moussa, Matriculation: 51234. SON 4. The Accident Report class (Sopts) The involvement array can have at most 10 elements b. The date data field should include the current date (exact date of object creation) c. The borvehicle should register the real number of involved Vehicle how many elements has been added to the array) . The AccidentReport O constructor will create an object with the current date, involvement array of size 10 and abovehicle equal to zero. e addew Vehicle Vehicle) adds new Vehicle to the array if the array is not fcruiserMotovolved returns true fa Motorcycle of type Cruiser has been involved in the accident And false otherwise by searching the involvement array & countAutomatical) returns the number of automatic cars that has been involved in this accident by searching the involvement array h displayOwners). Display the names of owners of all involved Vehicles

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Were members encouraged to participate?

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago