Question: Problem 4 : Write a program to calculate parking cost for a vehicle using a switch statement considering the following table: table [ [
Problem : Write a program to calculate parking cost for a vehicle using a switch statement considering the following table:
tableCar type charFirst hours cost,Rate After hours per hourCAED AED LAED AED
The program prompts the user to insert car type and positive duration. Rates are constant variables.
Input Output Samples:
Znter the vehicle type C or e for car and L or for lorry: a Enter the duration in hours:
Invalid vehicle type
Enter the vehicle type C or C for car and or for lorry: Enter the duration in hours:
Invalid duration
Bnter the vehicle type C or c for car and L or for lorry: c
Enter the duration in hours:
The cost of parking is : ARD
Enter the vehicle type C or for car and or I for lorry: I
Enter the duration in hours:
The cost of parking is : AED
I need answer with c
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
