Answered step by step
Verified Expert Solution
Question
1 Approved Answer
table [ [ Element of the class,Description,Marks ] , [ CompanyCar , Packaged concrete class, 4 ] , [ table [ [ regNumber
tableElement of the class,Description,MarksCompanyCarPackaged concrete class,tableregNumberdriverspeedoReadingtripsTakentableThe company car must have a vehicle registration number regNumber The car will have anallocated driver.The kilometres the car had travelled will be indicated by the speedometer. speedoReadingand there will be a list of trips that were taken by the driver with this company car.CompanyCarString String, String, StringtableThe parameterized constructor will receive the following order, the registration number ofthe vehicle, the sumame of the driver, the staff number for the driver, and the driver'slicense 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 speedoreading Invoke the lastTripEndReading method to get this value.CompanyCarString DrivertableThe overloaded parameterized constructor will receive the vehicle registration number andthe driver object as parameters to initialize the specific instance data members.The speedoReading instance data member must be assigned the last trip's end speedoreading Invoke the lastTripEndReading method to get this value.tablesetSpeedoReadingintsetDriverDriver:Mutator methods.,tablegetSpeedoReadinggetDriverAccessor methods.,lastTripEndReadingtableThe 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.newTripTripThe method will add the new parameter trip to the list of trips.,claimAmountWorkTripstableThe purpose of the method is to determine and return the total claims that the driver willmake for all the work trips taken.The driver may claim R for every work trip kilometre travelled.
Table Class Description CompanyCarQuestion Polymorphism and Composition:
Preparation:
Create a new NetBeans project called Question
Download and extract the needFilesSick.zip from EC
Under the folder Q you will find the needed files for this question.
Add the provided Trips.jar file to the "Libraries" for Question 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 Question project.
Add a new Java Class called CompanyCar to the Question 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 and description table Table and complete the CompanyCar concrete class. Pleasese write it so fast i will upvote
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started