Question: Part 4 - Define Function for Vehicle Assessment At this stage in the process the customer's vehicle is sent to one of the available mechanics

Part 4- Define Function for Vehicle Assessment
At this stage in the process the customer's vehicle is sent to one of the available mechanics on duty for a preliminary assessment.
assessVehicle: CustomerRegister, CID, SCL -> HHMM
During this preliminary assessment, the mechanic will take into consideration some key factors that will affect the price of the service. The customer would have already indicated what the limit is that they are willing to pay (Pay Limit - PL). If the cost of the servicing goes over that limit by more than \(5\%\), the mechanic's assessment cost should make a note on the register but remove the lowest costs from the list until it is within that \(5\%\) threshold.
There is a servicing cost list which denotes the general cost for certain tasks or jobs to be done on a vehicle based on the make (MK) of the vehicle. The servicing cost list is of the format:
("CL",([Mk,(EH, ET),(TC, ET),(ShT, ET)]))
The servicing cost list is a tagged tuple with two elements; the first element is a tag "CL", and the second element is a tuple of lists of servicing costs per each make of vehicle:
- Mk - Make of Vehicle
- FH - Full house check cost (float)
- TC - Tyre Change cost (float)
- ShT - shocks test cost (float)
- ET - Estimated time for the service activity.
Write a function assessVehicle () that accepts a customer register, customer Id and a servicing cost list as parameters, updates service cost and the estimated time for servicing in the customer record that matches the given customer Id, and returns the estimated pickup time HHMM as a string in 24-hour format
- If the vehicle is more than five years old and the make ( Mk\()\) is not a Benz, then the mechanic will have to do a full house check.
- A mileage over 100,000 will incur a shocks test if a full house is not being done.
- Tyres will need to be changed if the last service date is more than 10 months ago.
The estimated pickup time is five (5) minutes before the calculated time between the customer's arrival time and service time.
Part 4 - Define Function for Vehicle Assessment

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