Langkawi Ro-Ro Ferry Services Sdn. Bhd provide a services of carrying cars to Langkawi Island. As a programmer of this company, develop a travel expenses calculator program that reads vehicle type and passenger type travelled as inputs and calculate the total of fares that need to be paid from Kuala Perlis Jetty to Langkawi Jetty. 5% discount is given if total passenger is more than 4 passengers (excluding drivers). Table 1 shows fares of vehicle type and Table 2 shows the fares for passenger type. Repeat the same task using repetition structure until user enter 'n' for no. At the end of the program produce total cost and total distance for the whole journey. Table 1: Fares of Vehicle Туре Vehiele Type Description Fare (RM) 312.00 Car below 1500ce Car below 2000ce MPV below 2000cc Car below 1500cc Car below 2000ce MPV/SUV/4x4/Jeep/Pickup below 2000ce 2 368.00 3 412.00 MPV above 2000 MPV/SUV/4x4/Jeep/Pickup between 2000cc - 3000cc Motoreycle below 125cc Motoreycle above 500cc 4 456.00 3000cc Motoreycle 104.00 6. Motoreycle 170.00 Table 1: Fares of Vehicle Туре Description Passenger Туре Driver Fare (RM) 0.00 Driver 12 years old and above Below 12 years old Below 2 years old (No seat provided) Adult 36.00 3 Children 26.00 4 Infant 6.00 Use if...else statements or switch statements and loop where it is appropriate and create a program with the following output (The numbers in bold/underline are user's input):

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
Write a C program
Langkawi Ro-Ro Ferry Services Sdn. Bhd provide a services of carrying cars to Langkawi
Island. As a programmer of this company, develop a travel expenses calculator program that
reads vehicle type and passenger type travelled as inputs and calculate the total of fares that
need to be paid from Kuala Perlis Jetty to Langkawi Jetty. 5% discount is given if total
passenger is more than 4 passengers (excluding drivers).
Table 1 shows fares of vehiele type and Table 2 shows the fares for passenger type. Repeat
the same task using repetition structure until user enter 'n' for no. At the end of the program
produce total cost and total distance for the whole journey.
Table 1: Fares of Vehicle
Туре
Vehicle Type
Description
Fare
(RM)
312.00
Car below 1500cc
Car below 2000cc
Car below 1500cc
2
Car below 2000cc
368.00
3
MPV below 2000cc
MPV/SUV/4x4/Jeep/Pickup below
412.00
2000cc
4
MPV above 2000 -
MPV/SUV/4x4/Jeep/Pickup between
456.00
3000cc
2000cc - 3000cc
Motoreycle
Motorcycle below 125cc
Motorcycle above 500cc
5
104.00
6
Motorcycle
170.00
Table 1: Fares of Vehicle
Passenger
Туре
Driver
Туре
Description
Fare
(RM)
0.00
Driver
12 years old and above
Below 12 years old
Below 2 years old (No seat provided)
2
Adult
36.00
3
Children
26.00
4
Infant
6.00
Use if...else statements or switch statements and loop where it is appropriate and create a
program with the following output (The numbers in bold/underline are user's input):
Example output should be as follows:
*******
* LANGKAWI RO-RO FERRY SERVICES**********
Please enter vehicle type: 2
Please enter passenger type: 2
Please enter number of passengers of type 2: 2
Any other passenger? Y
Please enter passenger type: 3
Please enter number of passengers of type 3: 2
Any other passenger? N
SUMMARY
Price for vehicle type 2: RM368.00
Total number of passengers: 4
Price for passenger tYpe 2: RM72.00
Price for passenger type 3: RM52.00
Discount for passengers: RM117.80
Total price of ferry service: 485.80
(i)
Draw flowchart of the solution.
Write a complete C progrm bacad on the problem
Transcribed Image Text:Langkawi Ro-Ro Ferry Services Sdn. Bhd provide a services of carrying cars to Langkawi Island. As a programmer of this company, develop a travel expenses calculator program that reads vehicle type and passenger type travelled as inputs and calculate the total of fares that need to be paid from Kuala Perlis Jetty to Langkawi Jetty. 5% discount is given if total passenger is more than 4 passengers (excluding drivers). Table 1 shows fares of vehiele type and Table 2 shows the fares for passenger type. Repeat the same task using repetition structure until user enter 'n' for no. At the end of the program produce total cost and total distance for the whole journey. Table 1: Fares of Vehicle Туре Vehicle Type Description Fare (RM) 312.00 Car below 1500cc Car below 2000cc Car below 1500cc 2 Car below 2000cc 368.00 3 MPV below 2000cc MPV/SUV/4x4/Jeep/Pickup below 412.00 2000cc 4 MPV above 2000 - MPV/SUV/4x4/Jeep/Pickup between 456.00 3000cc 2000cc - 3000cc Motoreycle Motorcycle below 125cc Motorcycle above 500cc 5 104.00 6 Motorcycle 170.00 Table 1: Fares of Vehicle Passenger Туре Driver Туре Description Fare (RM) 0.00 Driver 12 years old and above Below 12 years old Below 2 years old (No seat provided) 2 Adult 36.00 3 Children 26.00 4 Infant 6.00 Use if...else statements or switch statements and loop where it is appropriate and create a program with the following output (The numbers in bold/underline are user's input): Example output should be as follows: ******* * LANGKAWI RO-RO FERRY SERVICES********** Please enter vehicle type: 2 Please enter passenger type: 2 Please enter number of passengers of type 2: 2 Any other passenger? Y Please enter passenger type: 3 Please enter number of passengers of type 3: 2 Any other passenger? N SUMMARY Price for vehicle type 2: RM368.00 Total number of passengers: 4 Price for passenger tYpe 2: RM72.00 Price for passenger type 3: RM52.00 Discount for passengers: RM117.80 Total price of ferry service: 485.80 (i) Draw flowchart of the solution. Write a complete C progrm bacad on the problem
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY