Question
Sri Purnama bus company wants to provide a computer system to facilitate ticket payments. The company provides 6 travel destinations namely Butterworth, Sungai Petani, Kangar,
Sri Purnama bus company wants to provide a computer system to facilitate ticket payments. The company provides 6 travel destinations namely Butterworth, Sungai Petani, Kangar, Taiping, Baling and Kuala Kangsar. The ticket price for each destination is as below.
DESTINATION PRICE
ButterworthRM35
Sungai PetaniRM45
KangarRM65
TaipingRM25
Baling RM50
Kuala KangsarRM18
This bus company provides 10% discount on ticket prices for destination Kangar and Baling. While, 5% discount on ticket prices for destination Taiping and Sungai Petani. Other destinations will be given 3% discount if the price of tickets is more than RM100.
When a ticket buyer pays a certain amount of money, the system will calculate the balance that should be given to the ticket buyer. The program only stop the execution when the user enter n.
Use the codes below to represent the destination.
BButterworth
SSungai Petani
KKangar
TTaiping
GBaling
LKuala Kangsar
Examples of the outputs are as follows:
Sri Purnama Bus Company
----------------------------------------------------------------------
Destination: K
Number of ticket:2
Amount paid by the ticket buyer:150
Price of the tickets:130
Discount:13
Balance:33
---------------------------------------------------------------------
Do you want to continue ( y / n ) :y
---------------------------------------------------------------------
Sri Purnama Bus Company
----------------------------------------------------------------------
Destination: B
Number of ticket:3
Amount paid by the ticket buyer:120
Price of the tickets:105
Discount:0
Balance:15
---------------------------------------------------------------------
Do you want to continue ( y / n ) :n
---------------------------------------------------------------------
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started