Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!