0% found this document useful (0 votes)
3 views

The Algorithm (2)

The MobayTerminal algorithm processes bus terminal activities by collecting data on bus registration numbers, owners' names, capacity, and number of entries. It calculates the flat charge based on capacity, total toll, applicable discounts, and total due for each bus until a registration number of zero is entered. The algorithm outputs a breakdown of these financial details for each bus entered.

Uploaded by

rankineesther6
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

The Algorithm (2)

The MobayTerminal algorithm processes bus terminal activities by collecting data on bus registration numbers, owners' names, capacity, and number of entries. It calculates the flat charge based on capacity, total toll, applicable discounts, and total due for each bus until a registration number of zero is entered. The algorithm outputs a breakdown of these financial details for each bus entered.

Uploaded by

rankineesther6
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Algorithm MobayTerminal

This algorithm reads the activities of the bus terminal and accepts capacity, number of
entries for an unspecified number of buses, bus registration number and owner’s name, The
data entry stops when zero is entered as a bus registration number, and the algorithm
should print a breakdown of total toll, total due, flat charge and discount, for each bus.

Variable

name, busregnumber, name ;string

entries, capacity ; integer.

flatcharge, totaldue, discount, totaltoll; real

Start

Print "Montego Bay Bus Terminal"

Repeat

Print " Please enter bus registration number, add zero to stop data entry”

Read busregnumber

Print " Please enter owner's name?

Read name

Print "Please enter Capacity"

Read capacity

Print "Please enter number of entries"

Read entries

If capacity < 18 then


Flat charge = 50

else

Flat charge = 75

endif

Print “ The flat charge is;” flatcharge

total toll = entries * flat fee

Print “The total toll is ;” totaltoll

If entries < 150

discount = total toll * 0.03

else

discount = total toll * 0.1

endif

Print “The discount is; discount,

total due = total toll - discount

Print “ The total due is, totaldue,

Until busregnumber =0

Stop

You might also like