I want to make this program using switch I don't know where to start? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

I want to make this program using switch I don't know where to start?

Write a rogram thatc lculates parking fees for a multilevel parking ge age. Ask whether the driver is in a car or a truck. Charge the driver $2.00 for the first hour, $3.00 for the second, and $5.00 for more than 2 hours. If it is a truck, add $1.00 to the total fee.

15th Jan 2022, 5:22 PM
SAROK彡 COBRA
SAROK彡 COBRA - avatar
4 Réponses
+ 2
SAROK彡 COBRA There are two types of vehicle truck or car If driver drives 1 hour then charge is $2 If driver drives 2 hour then charge is $3 If driver drives more than 2 hours then charge is $5 So you can use if else here and calculate total charge. This charge would be according Car. If driver drives truck then add $1 in calculated charge. You can use switch case to decide whether it is truck or car.
15th Jan 2022, 5:43 PM
A͢J
A͢J - avatar
+ 1
So where is your attempts?
15th Jan 2022, 5:25 PM
A͢J
A͢J - avatar
+ 1
Thank you so much I understand
15th Jan 2022, 5:48 PM
SAROK彡 COBRA
SAROK彡 COBRA - avatar
0
I don't know where to start?
15th Jan 2022, 5:27 PM
SAROK彡 COBRA
SAROK彡 COBRA - avatar