Question

USE PYTHON. Notice that the output needs to be as it is required. 4.18 LAB*: Program:...

USE PYTHON. Notice that the output needs to be as it is required.

4.18 LAB*: Program: Automobile service invoice

(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:

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

Select first service:
Tire rotation
Select second service:
-

Davy's auto shop invoice

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

Total: $19

Homework Answers

Answer #1
def automotive_service():
    print("To select service from the menu type service name. If you don't want to select any service you can enter -.");
    service1 = input("Select first service: ").lower();
    service2 = input("Select second service: ").lower();

    if service1 not in services.keys() or service2 not in services.keys():
        print("Please enter valid service from menu")
        automotive_service()
    else:
        if service1 == '-':
            print('Service 1: No service');
        else:
            print('Service 1: ' + service1 + ', $' + services[service1]);
        if service2 == '-':
            print('Service 2: No service');
        else:
            print('Service 2: ' + service2 + ', $' + services[service2]);
        total = int(services[service1]) + int(services[service2])
        print("Total: $" + str(total));


if __name__ == '__main__':
    print("Davy'a auto shop services");
    print("Oil change -- $35 \nTire rotation -- $19 \nCar wash -- $7 \nCar wax -- $12");

    services = {
        'oil change': '35',
        'tire rotation': '19',
        'car wash': '7',
        'car wax': '12',
        '-': '0'
    }

    automotive_service()

If you like the answer please don't forget to upvote. Thank you Stay safe

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
5.27 LAB*: Program: Soccer team roster (Vectors) This program will store roster and rating information for...
5.27 LAB*: Program: Soccer team roster (Vectors) This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balanced team. (1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers in one int vector and the ratings in another int vector. Output these vectors (i.e., output the roster). (3 pts) Ex: Enter player...
PLEASE POST IN C++ : Thank you!! 5.27 LAB*: Program: Soccer team roster (Vectors) This program...
PLEASE POST IN C++ : Thank you!! 5.27 LAB*: Program: Soccer team roster (Vectors) This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balanced team. (1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers in one int vector and the ratings in another int vector. Output these vectors (i.e., output...
USE PYTHON Please!!! 4.15 LAB: Exact change Write a program with total change amount as an...
USE PYTHON Please!!! 4.15 LAB: Exact change Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 (or less than 0), the output is: No change Ex: If the input is: 45 the output is: 1...
This program extends the earlier "Online shopping cart" program. (Consider first saving your earlier program). Extend...
This program extends the earlier "Online shopping cart" program. (Consider first saving your earlier program). Extend the ItemToPurchase class per the following specifications              Private fields string itemDescription - Initialized in default constructor to "none" Parameterized constructor to assign item name, item description, item price, and itemquantity (default values of 0).             Public instance member methods setDescription() mutator & getDescription() accessor (2 pts) printItemCost() - Outputs the item name followed by the quantity, price, and subtotal printItemDescription() - Outputs the...
USING C++ The purpose of this assignment is the use of 2-dimensional arrays, reading and writing...
USING C++ The purpose of this assignment is the use of 2-dimensional arrays, reading and writing text files, writing functions, and program planning and development. You will read a data file and store all of the input data in a two dimensional array. You will perform calculations on the data and store the results in the 2 dimensional array. You will sort the array and print the results in a report. Instructions You will read in the same input file...
Question 1 2.5 pts 1. The perfectly competitive firm's demand curve is horizontal at the market...
Question 1 2.5 pts 1. The perfectly competitive firm's demand curve is horizontal at the market price. True False Flag this Question Question 2 2.5 pts 2. In perfect competition, the market price is established at the intersection of the market demand and market supply curves in the industry and the individual firms are "price takers" of that market price. True False Flag this Question Question 3 2.5 pts 3. The perfectly competitive firm will continue to produce in the...
The following statement is true is all respects: Organizations that make up the supply chain are...
The following statement is true is all respects: Organizations that make up the supply chain are “linked” together through physical, financial and information flows forming partnerships that add value to the customer experience. True False Flag this Question Question 3 1 pts Supply chain management is undergoing a level of transformation, not unlike other disciplines. Which of the selections below best represents this transformation. Business Logistics Physical Distribution Integrated Business Planning Its not transforming Flag this Question Question 4 1...
I completed everything except for the last part. I know my answers are right because i...
I completed everything except for the last part. I know my answers are right because i double checked but i just dont know how to answer the last section. Problem 3-1 Schedule C (LO 3.1) Scott Butterfield is self-employed as a CPA. He uses the cash method of accounting, and his Social Security number is 644-47-7833. His principal business code is 541211. Scott's CPA practice is located at 678 Third Street, Riverside, CA 92860. Scott’s income statement for the year...
Score for this attempt: 69 out of 75 Submitted Apr 10 at 10:59am This attempt took...
Score for this attempt: 69 out of 75 Submitted Apr 10 at 10:59am This attempt took 74 minutes. Question 1 1.5 / 1.5 pts Process manufacturing usually reflects a manufacturer that produces small quantities of unique items.    True Correct!   False Question 2 1.5 / 1.5 pts On a common-sized income statement, all items are stated as a percent of total assets or equities at year-end. Correct!   False     True Question 3 1.5 / 1.5 pts A single plantwide overhead...
Please Check the wrong ones! 1. Which of the following best describes scarce resources? a. Resources...
Please Check the wrong ones! 1. Which of the following best describes scarce resources? a. Resources for which the quantity that people want exceeds the quantity that is freely available b. Resources that most people cannot afford to buy c. Resources for which the quantity demanded is the same for all economic agents d. Resources that can only be distributed efficiently by the government 2. Which of the following statements is true of models? a. It is more important for...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT