1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tino4ka555 [31]
3 years ago
3

Write a program to calculate the total price for car wash services. A base car was is $10. A dictionary with each additional ser

vice 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 along with the corresponding costs and then the total price for all car wash services.Ex: If the input is:Tire shineWaxthe output is:ZyCar WashBase car wash -- $10Tire shine -- $2Wax -- $3----Total price: $15Ex: If the input is:Rain repellent-the output is:ZyCar WashBase car wash -- $10Rain repellent -- $2----Total price: $12services = { 'Air freshener' : 1 , 'Rain repellent': 2, 'Tire shine' : 2, 'Wax' : 3, 'Vacuum' : 5 }base_wash = 10total = 0service_choice1 = input()service_choice2 = input()''' Type your code here '''
Computers and Technology
1 answer:
Georgia [21]3 years ago
7 0

Answer:

Replace

''' Type your code here '''

with the following lines of code:

price1 = services[service_choice1]

price2 = 0

if not (service_choice2 == "-"):

   price2 = services[service_choice2]

total = base_wash + price1 + price2

print("Zycar Wash")

print("Base car wash: $"+str(base_wash))

print(service_choice1+str(": $")+str(price1))

print(service_choice2+str(": $")+str(price2))

print("Total price: $"+str(total))

Explanation:

The complete program with explanation is as follows:

The italicized lines were originally part of the question

<em>services = { 'Air freshener' : 1 , 'Rain repellent': 2, 'Tire shine' : 2, 'Wax' : 3, 'Vacuum' : 5 }</em>

<em>base_wash = 10</em>

<em>total = 0</em>

<em>service_choice1 = input()</em>

<em>service_choice2 = input()</em>

This line gets the price of service choice 1

price1 = services[service_choice1]

This line initialzes price of service choice 2 to 0

price2 = 0

If an additional service (i.e. service choice 2) is selected

if not (service_choice2 == "-"):

This line gets the price of service choice 2

   price2 = services[service_choice2]

This calculates the total price

total = base_wash + price1 + price2

This prints the header

print("Zycar Wash")

This prints the base car wash

print("Base car wash: $"+str(base_wash))

This prints the service choice 1

print(service_choice1+str(": $")+str(price1))

This prints the service choice 2

print(service_choice2+str(": $")+str(price2))

This prints the total

print("Total price: $"+str(total))

You might be interested in
True/False: Functions are ideal for use in menu-drive programs. When a user selects a menu item, the program can call an appropr
AlladinOne [14]

Answer: true

Explanation: you can find it on quizlet

7 0
3 years ago
10 disscused reasons why organisatoions use electronic spreedsheet​
alina1380 [7]

Well, In any accounting role, you can benefit from incorporating spreadsheets into everyday tasks, making your job streamlined and easier to manage. If you’re looking to progress onto AAT Level 3 Advanced Diploma, it’s good to see how spreadsheets can support you.

a) Easy payment tracking  - While small business owners and those new to accounting can find it difficult to track payments, spreadsheets offer a simple solution.  Spreadsheets are commonly used to analyse money that has been spent and income that has been received. They allow you to split the amount of money you have spent and received by time period and source. For example, you can separate out different types of expenditure such as rent or insurance, and track exactly how much can been spent on these in each month, by using a simple table.

8 0
3 years ago
What game is a great example of a story unfolding as the levels increase where the player learns more about the plight of the pr
Phantasy [73]
Fortnite and mario kart are good examples
4 0
3 years ago
Read 2 more answers
Whats the best way to get into a computers programming to get past firewalls
raketka [301]

you can use the software psiphon

6 0
3 years ago
Read 2 more answers
What is the name of the computer that access shared resources on the network<br><br>​
tangare [24]

Answer:

what is the name of the computer that access shared resources on the network

5 0
3 years ago
Read 2 more answers
Other questions:
  • The ____ operator eliminates duplicate values in the results of a query.
    11·1 answer
  • Qual foi o primeiro computador no mundo a ser criado e qual é a hitória por trás?
    8·1 answer
  • A(n) ____ database is an application appropriate for an object-oriented database that contains text links to other types of docu
    7·1 answer
  • Assume you had a .csv file with data already populated that you wanted to use for a mail merge. Which button would you press to
    8·1 answer
  • For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions)
    13·1 answer
  • to _________________________ is a mouse operation in which you move the mouse until the pointer on the desktop is positioned on
    7·1 answer
  • To uncompress the data back into its original binary state, you simply reverse the process. This technique is an example of what
    7·1 answer
  • Write an algorithm and flowchart to display H.C.F and L.C.M of given to numbers.​
    9·1 answer
  • A student wrote a song. Another student posted a video of the song on You Tube, claiming to have written the song. This is most
    15·1 answer
  • Who is the traitor of UA?<br><br>1 Karishma<br><br>2 Yuga Aoyama<br><br>3 Denki <br><br>4 Mineta
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!