Questions Uploads

Output

ok here is the prompt:

(1) Output a menu of automotive services and the corresponding cost of each service. (2 pts) 

Ex:

Davy's auto shop services
Oil change -- $35
Tire rotation -- $19
Car wash -- $7
Car wax -- $12

(2) Prompt the user for two services from the menu. (2 pts) 

Ex:

Select first service: Oil change

Select second service: Car wax

(3) Output an invoice for the services selected. Output the cost for each service and the total cost. (3 pts) 

Davy's auto shop invoice

Service 1: Oil change, $35
Service 2: Car wax, $12

Total: $47

(4) Extend the program to allow the user to enter a dash (-), which indicates no service. (3 pts) 

Ex:

Select first service: Tire rotation

Select second service: -


Davy's auto shop invoice

Service 1: Tire rotation, $19
Service 2: No service

Total: $19

Here is my code…

# make a dictionary for Davy’s auto shop

davy_auto_services = {

  ‘Oil change’: 35,

  ‘Tire rotation’: 19,

  ‘Car wash’: 7,

  ‘Car wax’: 12

}   

print(“Davy’s auto shop services”)

for key, value in davy_auto_services.items():

  print(key, ‘– $’ + str(value))

print(”)

first_service = input(‘Select first service: n’)

print(”)

second_service = input(‘Select second service: n’)

print(”)

print(“nDavy’s auto shop invoicen”)

#make if statement to loop 

if first_service in davy_auto_services:

  print(‘Service 1:’, first_service + ‘, $’ + str(davy_auto_services[first_service]))

else:

  print(‘Service1: No service’)

#make if statement for sevice 2  

if second_service in davy_auto_services:

  print(‘Service 2:’, second_service + ‘, $’ + str(davy_auto_services[second_service]))     

else: 

  print(‘Service 2: No service’)

print(”)  

total = davy_auto_services.get(first_service) + davy_auto_services.get(second_service)

print(‘Total: $’+ str(total))

if first_service not in davy_auto_services:

  print(‘Total: $’)

#elif second_service not in davy_auto_services:

 #print(‘Total: $’ + str(second_service_total))

#if second_service not in davy_auto_services:

  #print(‘Total: $’ + str(total_two))

I CANNOT figure out the last portion, to have it only print the one price,

Top Answer

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

a EOF error

Hello I am trying to make a program to help asset the cost of painting. I have wrtten a code for it, but I keep getting a EOF error. I have been at this for hours now and I cant figure this out.

import math

# Dictionary of paint colors and cost per gallon

paintColors = {

‘red’: 35,

‘blue’: 25,

‘green’: 23

}

# FIXME (1): Prompt user to input wall’s width

# Calculate and output wall area

wallHeight = float(input(‘Enter wall height (feet):n’))

wallwidth = float(input(‘Enter wall width (feet):n’))

wallArea = int(wallHeight * wallwidth)

print(‘Wall area:’, wallArea, ‘square feet’) 

# FIXME (2): Calculate and output the amount of paint in gallons needed to paint the wall

paintNeeded = wallArea / 350

print(‘Paint needed: %f’ % paintNeeded, ‘gallons’)

cansNeeded = math.ceil(paintNeeded)

print(‘Cans needed:’, cansNeeded,’can(s)n’)

# FIXME (3): Calculate and output the number of 1 gallon cans needed to paint the wall, rounded up to nearest integer

# FIXME (4): Calculate and output the total cost of paint can needed depending on color

paintColor = input()

print(‘Choose a color to paint the wall:’)

paintCost = {‘red’:35, ‘blue’:75}

print(‘Cost of purchasing’, paintColor, ‘paint: $’, paintCost)

That is what I have so far, the error I keep getting is: Enter wall height (feet):nTraceback (most recent call last):

File “main.py”, line 13, in <module>

wallHeight = float(input(‘Enter wall height (feet):n’))

EOFError: EOF when reading a line

Please help

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

algorithm

Why might you combine a sorting algorithm with another algorithm you have learned so far?

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

Output

This is for CS 200 not sure what i keep doing wrong python 3 coding:

2.13 Program: Food receipt (Python 3)

Note: When accuracy is essential, floats are not used to represent currency due to rounding and accumulation errors. Python provides several primitives specifically developed to implement financial applications. However, these topics are beyond the scope of this lab.

(1) Prompt the user to input a food item name, price, and quantity. Output an itemized receipt. (Submit for 2 points)

Enter food item name: hot dog
Enter item price: 2
Enter item quantity: 5

RECEIPT
5 hot dog @ $ 2.0 = $ 10.0
Total cost: $ 10.0

(2) Extend the program to prompt the user for a second item. Output an itemized receipt. (Submit for 2 points, so 4 points total)

Enter food item name: hot dog
Enter item price: 2
Enter item quantity: 5

RECEIPT
5 hot dog @ $ 2.0 = $ 10.0
Total cost: $ 10.0


Enter second food item name: ice cream
Enter item price: 2.50
Enter item quantity: 4

RECEIPT
5 hot dog @ $ 2.0 = $ 10.0
4 ice cream @ $ 2.5 = $ 10.0
Total cost: $ 20.0

(3) Extend again to output a third receipt that adds a mandatory 15% gratuity to the total cost. Output the total cost, the cost of gratuity, and the grand total. (Submit for 3 points, so 7 points total)

Enter food item name: hot dog
Enter item price: 2
Enter item quantity: 5

RECEIPT
5 hot dog @ $ 2.0 = $ 10.0
Total cost: $ 10.0


Enter second food item name: ice cream
Enter item price: 2.50
Enter item quantity: 4

RECEIPT
5 hot dog @ $ 2.0 = $ 10.0
4 ice cream @ $ 2.5 = $ 10.0
Total cost: $ 20.0

15% gratuity: $ 3.0
Total with tip: $ 23.0

This is what I did and my code is wrong on the very last part specifically line 20 please help

# FIXME (3): Add a gratuity and total with tip to the second receipt

(line 20 where it says im wrong)

tip: =0.15 * (item_Qty * item_Price + item_Qty2 * item_Price2))

Top Answer

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"