[go: up one dir, main page]

0% found this document useful (0 votes)
25 views2 pages

The Algorithm

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

Uploaded by

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

The Algorithm

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

Uploaded by

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

Algorithm Terminal

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 "Enter owner's name?

Read name

Print "Enter Capacity"

Read capacity

Print "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