The document outlines 3 functions to calculate vehicle rental and hire costs. Function 1 calculates total rental cost based on vehicle number, rental dates, and whether a driver is included. Function 2 calculates day tour hire costs based on vehicle, package type, times, and kilometer readings. Function 3 calculates long tour hire costs based on vehicle, package type, dates, and kilometer readings. All functions return different cost components that make up the total cost.
The document outlines 3 functions to calculate vehicle rental and hire costs. Function 1 calculates total rental cost based on vehicle number, rental dates, and whether a driver is included. Function 2 calculates day tour hire costs based on vehicle, package type, times, and kilometer readings. Function 3 calculates long tour hire costs based on vehicle, package type, dates, and kilometer readings. All functions return different cost components that make up the total cost.
The document outlines 3 functions to calculate vehicle rental and hire costs. Function 1 calculates total rental cost based on vehicle number, rental dates, and whether a driver is included. Function 2 calculates day tour hire costs based on vehicle, package type, times, and kilometer readings. Function 3 calculates long tour hire costs based on vehicle, package type, dates, and kilometer readings. All functions return different cost components that make up the total cost.
3.1 Design suitable algorithms for vehicle tariff calculation for rents and hires. Ideally, 3 functions should be developed for this purpose as follows:
Function 1: Rent calculation.
Return the total rent_value when vehicle_no, rented_date, return_date, with_driver Parameters are sent in. with_driver parameter is set to true or false depending whether the Vehicle is rented with or without driver.
IF with driver = 0 THEN Type = “FALSE” ELSE Type = “TRUE” END IF Return total rent_value
Function 2: Day tour - hire calculation.
Calculate total hire_value when vehicle_no, package_type, start_time, end_time, start_km_reading, end_km_reading parameters are sent in. Should return base_hire_charge, Waiting_charge and extra_km_charge as output parameters.
start_km_reading, end_km_reading CALCULATE total hire_value Return base_hire_charge, Waiting_charge and extra_km_charge Function 3: Long tour - hire calculation. Calculate total hire_value when vehicle_no, package_type, start_date, end_date, start_km_reading, end_km_reading parameters are sent in. Should return base_hire_charge, overnight_stay_charge and extra_km_charge as output parameters.
INPUT when vehicle_no, package_type, start_date, end_date,
start_km_reading, end_km_reading CALCULATE total hire_value Return base_hire_charge, Waiting_charge and extra_km_charge