Write a program to calculate the total price for car wash services. A base car wash is $10. A dictionary with each additional service and the corresponding cost has been provided. Two additional services can be selected. A signifies an additional service was not selected. Output all selected services, according to the input order, along with the corresponding costs and then the total price for all car wash services. Ex: If the input is: Tire shine Wax the output is: ZyCar Wash Base car wash - $10 Tire shine - $2 Wax - $3 Total price: $15
Below code first defines a dictionary of additional services and their costs. It then reads the user's choices for additional services as two separate strings. The program then adds the base car wash price to the total cost and outputs the name of the car wash business and the base car wash price.
The code then checks if the user selected the first additional service. If they did, the program outputs the name of the service and its cost, and adds the cost of the service to the total cost. The code then checks if the user selected the second additional service. If they did, the program outputs the name of the service and its cost, and adds the cost of the service to the total cost.
Finally, the program outputs a separator line and the total cost of all selected car wash services.
Step by step
Solved in 2 steps with 2 images