Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 .
image text in transcribed

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

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

Did you add the logo at correct size and proportion?

Answered: 1 week ago