Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C program that calculates the cost of transporting a passenger's luggage according to Table 1 below. The program should let a user enter
Write a C program that calculates the cost of transporting a passenger's luggage according to Table 1 below. The program should let a user enter the class of the passenger and the weight of his or her luggage and then displays the cost. Red is entered by a user Sample Code Execution #1 Enter Passenger Class (E for Economy, B for Business, V for VIP): B Enter luggage weight: 39 Total cost is $5.00 Sample Code Execution #2 Enter Passenger Class (E for Economy, B for Business, V for VIP): E Enter luggage weight: 43.5 Total cost is $29.50 Sample Code Execution #3 Enter Passenger Class (E for Economy, B for Business, V for VIP): D Enter luggage weight: 35 Wrong passenger class Test cases: (Passenger Class, Weight) = (V, 75), (E, 15), (B, 60), (E, 35), (P, 25)
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