0% found this document useful (0 votes)
35 views1 page

Pseudo Code

The function calculates the rental amount for a vehicle based on the rented and return dates, vehicle registration number, and whether a driver is included. It computes the total number of days, months, weeks, and additional days to determine the rental charges using predefined rates. If the vehicle is not found in the records, it displays an error message; otherwise, it shows the calculated rental amount.

Uploaded by

Dinu Edirisinghe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

Pseudo Code

The function calculates the rental amount for a vehicle based on the rented and return dates, vehicle registration number, and whether a driver is included. It computes the total number of days, months, weeks, and additional days to determine the rental charges using predefined rates. If the vehicle is not found in the records, it displays an error message; otherwise, it shows the calculated rental amount.

Uploaded by

Dinu Edirisinghe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

function rental(rented_date, return_date,regno,withdr)

nodays=return_date-rented_date
months = nodays/30/*assumed 30 days per month*/
remainder=months%30
weeks=remainder/7
days=remainder%7
find the required vehicle record from vehicle table
if (found)then
display monthrate, weekrate, dayrate and driverrate
amount=months*monthrate+weekrate+days*dayrate
if(withdr==true)then
amount=amount+nodays*driverrate
endif
display amount
else
display "vehicle not found"
endif
end function

You might also like