You are on page 1of 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