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
Paha777 [63]
3 years ago
15

(1) Output a menu of automotive services and the corresponding cost of each service. (2 pts) Ex: Davy's auto shop services Oil c

hange -- $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



Has to work in Python 3
Computers and Technology
1 answer:
Wittaler [7]3 years ago
3 0

Answer:

service1_cost = 0

service2_cost = 0

print("Davy's auto shop services")

print("Oil change -- $35, Tire rotation -- $19, Car wash -- $7, Car wax -- $12")

service1 = input("Select first service: ")

service2 = input("Select second service: ")

if service1 == "Oil change":

   service1_cost = 35

elif service1 == "Tire rotation":

   service1_cost = 19

elif service1 == "Car wash":

   service1_cost = 7

elif service1 == "Car wax":

   service1_cost = 12

elif service1 == "-":

   service1 = "No service"

   service1_cost = 0

if service2 == "Oil change":

   service2_cost = 35

elif service2 == "Tire rotation":

   service2_cost = 19

elif service2 == "Car wash":

   service2_cost = 7

elif service2 == "Car wax":

   service2_cost = 12

elif service2 == "-":

   service2 = "No service"

   service2_cost = 0

print("- - -")

print("Davy's auto shop invoice")

print("Service 1: " + service1 + " costs $" + str(service1_cost))

print("Service 2: " + service2)

print("Total: $" + str(service1_cost + service2_cost))

Explanation:

- Initialize the variables for cost values

- Ask the user for the services

- Depending on the user choice, calculate the cost of each service using if else structure

- Print the chosen services, cost of each service and total cost    

You might be interested in
Date Time Manipulation Exploration If you start from Jan 1st, 1757, and repeatedly add 8 days, until you hit 1800, how many time
zimovet [89]

Answer:

from datetime import datetime, date, timedelta

def count_weekdays(start_date, add_days, stop_year, weekday):

   my_date = start_date

   m = 0  

   while my_date.year != stop_year:  

       my_date = my_date + timedelta(days = add_days)

       if my_date.isoweekday() == weekday:

           m += 1

   return m

date_val = date(1757,1,1)

try:

   date_val = datetime.fromisoformat(input("Enter date in the format yyyy-mm-dd: "))

except ValueError:

   print("Wrong isoformat string")

print(count_weekdays(date_val, 8, 1800, 1))

Explanation:

The datetime package of the python programming language has several time modules like the date, datetime, pytz, timedelta, etc, used to manipulate date and time in documents. The function count_weekdays has four parameters and returns the number of a specified weekday in a period of time.

4 0
3 years ago
Define a public static method named s2f that takes two String arguments, the name of a file and some text. The method creates th
frez [133]

Answer:

Java solution (because only major programming language that has public static methods)

(import java.io.* before hand)

public static boolean s2f(String fileName, String text){

   try{

       PrintWriter out = new PrintWriter(new File(fileName));

       out.println(text);

       out.close();

       return true;

   }

   catch(Exception e){

       return false;

   }

}

6 0
3 years ago
Divide the difference of 47 and 23 by the difference of 25 &13​
OleMash [197]

Answer:

The answer is 2

Explanation:

3 0
2 years ago
What is stored in a source file, an object file, and his executable file?
neonofarm [45]
A source file has source code, what a human understands. It isn't compiled or linked.

An object file has compiled, but not linked intermediary code.

An executable file has compiled and linked code which is executable.
6 0
3 years ago
Can someone tell me how to mark people the brainiest on a laptop?
Crazy boy [7]

When two people give answer to your question, then below their answer you will get a option Mark as Brainliest. You simply need to click that button

7 0
2 years ago
Other questions:
  • Given 3 floating-point numbers. Use a string formatting expression with conversion specifiers to output their average and their
    14·1 answer
  • Why should you log out when you finish an online session?
    9·1 answer
  • Functions that are built-in into PHP to perform some standard operations.
    15·1 answer
  • What is one course of action available in every problem solving process?
    9·2 answers
  • Probability can be used to determine the likelihood of specific __________
    6·2 answers
  • In Google search results, how are organic links different from sponsored links?
    5·2 answers
  • This is 6th grade career class.
    10·1 answer
  • Write a method named lastIndexOf that accepts an array of integers and an * integer value as its parameters and returns the last
    15·1 answer
  • Which operating system might cause the desktop background to change unexpectedly?
    7·1 answer
  • Write a python program to check whether the number is divisible by 7. If its divisible, print its divisible otherwise find previ
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!