Question: table [ [ Element of the class,Description,Marks ] , [ CompanyCar , Packaged concrete class, 4 ] , [ table [ [ regNumber

\table[[Element of the class,Description,Marks],[CompanyCar,Packaged concrete class,4],[\table[[regNumber],[driver],[speedoReading],[tripsTaken]],\table[[The company car must have a vehicle registration number (regNumber). The car will have an],[allocated driver.],[The kilometres the car had travelled will be indicated by the speedometer. (speedoReading)],[and there will be a list of trips that were taken by the driver with this company car.]],3],[CompanyCar(String, String, String, String),\table[[The parameterized constructor will receive the following order, the registration number of],[the vehicle, the sumame of the driver, the staff number for the driver, and the driver's],[license number.],[Use the received parameters to initialize the specific instance data members.],[The speedoReading instance data member must be assigned the last trip's end speedo],[reading. Invoke the lastTripEndReading() method to get this value.]],6],[CompanyCar(String, Driver),\table[[The overloaded parameterized constructor will receive the vehicle registration number and],[the driver object as parameters to initialize the specific instance data members.],[The speedoReading instance data member must be assigned the last trip's end speedo],[reading. Invoke the lastTripEndReading() method to get this value.]],5],[\table[[setSpeedoReading(int)],[setDriver(Driver):]],Mutator methods.,2],[\table[[getSpeedoReading()],[getDriver()]],Accessor methods.,2],[lastTripEndReading(),\table[[The method will find and return the end speedo reading of the last trip in the list of trips.],[Every trip has a start and an end reading.]],5],[newTrip(Trip),The method will add the new parameter trip to the list of trips.,3],[claimAmountWorkTrips(),\table[[The purpose of the method is to determine and return the total claims that the driver will],[make for all the work trips taken.],[The driver may claim R 3.24 for every work trip kilometre travelled.]],7]]
Table 4.2 Class Description (CompanyCar)Question 4(Polymorphism and Composition):
Preparation:
Create a new NetBeans project called Question4.
Download and extract the needFilesSick.zip from EC.
Under the folder 'Q4' you will find the needed files for this question.
Add the provided Trips.jar file to the "Libraries" for Question4 project.
Remember to Edit the added library and add the extracted "javadocs" folders as the Javadoc for this library.
Also add the Driver.jar file with its "javadocs" to the library for Question4 project.
Add a new Java Class called CompanyCar to the Question 4 project and complete the class as described below.
The questions:
A doctor is an abstract concept that treats patients.
A driver (Driver) of a company car can make two specific types of trips with the vehicle. It is either a trip for work purposes or for private purposes. The
WorkTrip and the PrivateTrip are both specific types of Trip objects.
You are provided with these created concrete classes (Trip, PrivateTrip, WorkTrip, Driver). Follow the provided API documentation together with the UML
class diagram below (Table 4.1) and description table (Table 4.2) and complete the CompanyCar concrete class. Pleasese write it so fast , i will upvote .
 \table[[Element of the class,Description,Marks],[CompanyCar,Packaged concrete class,4],[\table[[regNumber],[driver],[speedoReading],[tripsTaken]],\table[[The company car must have a

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 Databases Questions!