Passenger fare is classified according to the type of passenger. Senior Citizen enjoys 20% discount from the regular fare, Students get 10% discount. Regular passengers who do not qualified as neither Senior Citizen nor a Student should pay the regular fare of 100. Write an algorithm that will accept details of five (5) passengers, including its name and passenger type and will compute for the corresponding fare of each passenger. Display the name and type of passenger, as well as the computed fare.
Start
Declare variables passengername,type,discount,fare
for p=1 to 5
Read the passenger name
Read the passenger type
if passenger type=Senior Citizen then
discount=0.2
fare=100*discount
else if passenger type=Student then
discount=0.1
fare=100*discount
else
fare=100
end if
Display the passenger's name
Display the passenger's type
Display the passenger's fare
end for
Stop
Comments
Leave a comment