Rich (BB code):
Liz’s Taxi Service has proved so successful, boosted by her loyalty scheme for regular customers, that she has expanded her fleet to include vans and minibuses for hire, all driven by members of her highly-trained staff. Eager to maximise profits, she now wants to evaluate the efficiency of her drivers by logging each journey they make and analysing how swiftly they complete the job relative to the distance covered.
Each driver has a unique Driver Number. A journey takes place in a car, or van, or minibus (coded ‘C’, ‘V’ and ‘M’ respectively). The time taken (in whole minutes) and distance travelled (in whole miles) are both recorded.
To determine how speedily her drivers are working, Liz calculates the efficiency of each journey as the distance travelled divided by the time taken.*
Create a Java programto record each journey made by each driver in a file called journey.dat, and to perform various analysis tasks to assist Liz in monitoring driver efficiency. A typical line in the file might be
13 M 60 45
where driver 13 used a Minibus for 60 minutes and drove 45 miles. The efficiency value (calculated as necessary in the program, not stored in the file) would be 45 / 60 = 0.75
The system must be menu-driven and offer the following operations:
1.Append a new line of journey data to the file;
2.Provide a vehicle report for either
q one specific category of vehicle (C / V / M) or for
q each category of vehicle in turn (A for All)
showing for journeys in this vehicle either a
q Summary (S) – number of journeys and average efficiency or a
q Full report (F) – list of journeys (giving driver number and efficiency) plus summary information
3.Provide a listing of the ten most efficient journeys (displaying driver number and efficiency value for each) in descending order. (Where fewer than ten journeys have been recorded all should be listed.)
4.Exit the system.