Computers and Technology
Computers and Technology, 09.11.2020 05:10, minaricks

Please write in python: Week 1 (Print menu and take a selection)

At program start, you will print a menu with the contents of your vending machine.

Customize your own vending machine with items of your interest

Your vending machine should have at least 5 items

Accept items to be purchased, or until a sentinel value is entered.

Print the selected item after each selection.

Week 2 (Take many selections, calculate total, and accept payment)

Extend your code to allow users to repeatedly select items for purchase and keep a running subtotal

Your menu should contain a sentinel value for the user to select checkout as an option to finish shopping.

Check that the selection entered is an option of the menu. If not, then print an error message and start over requesting a new selection or to quit.

Calculate amount due with subtotal + sales tax (for your state).

Accept payment in whole dollars

Following the deposit (payment), calculate change due (difference between payment and amount due)

Week 3 (Dispense change)

Extend your code to determine the dollars and coins to be dispensed from the change due or as a refund. This calculation will depend on the payment accepted. For example, if the user selected items totaling $10.35 and they only deposit $7.00, they have provided insufficient payment.

Check that the payment received is greater than or equal to the amount due. If the payment is less than the amount due, then print an error message and prompt the user to enter sufficient funds. If the payment is equal to the amount due, then print a message saying “No change due.”

Print the number of dollars and coins to be dispensed and their denominations.

Week 4 (Incorporating functions)

Extend your code to include the following functions,

print_menu(): non-value returning function to print out the menu at the start of the program and after each item for purchase is chosen. This menu should contain a sentinel for the user to checkout when the user is finished selecting items.

calculate_total(new_item): a value returning function to add up the cost of the item selected.

make_change(change_due): (previous lab assignment): Calculate the users change (“Here is your change: “) in dollars and coins and print a closing message (“Have a great day”).

amount_due(total_price): a value returning function that prints a subtotal and final total that includes sales tax (for your state) added to the total. This function will also require the user to input a whole dollar amount for payment and return the amount of change due and should prompt the user to retry if too little cash is paid. Write a program that reads a list of integers into a list as long as the integers are greater than zero, then output the smallest and largest integers in the list.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:30, riah133
Creating "smart interfaces" in all sectors of industry, government, and the public arena is one of the fastest growing hct areas. these interfaces model, interpret, and analyze such human characteristics as speech, gesture, and vision. the field of biometrics, in which humans authenticate themselves to machines, is an area of considerable interest to hct practitioners. fingerprint scans are one of the most frequently used biometric options, and this article, biometric student identification: practical solutions for accountability & security in schools, makes a case for the implementation of fingerprint scans in schools. critique the article, and answer the following questions: according to the author, what are the main benefits of adopting fingerprint scans in schools for student identification? according to the author, what are the main drawbacks of adopting fingerprint scans in schools for student identification? do you agree with the author's assessment of the pl
Answers: 2
image
Computers and Technology, 23.06.2019 11:20, 1tzM3
Http is the protocol that governs communications between web servers and web clients (i. e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
image
Computers and Technology, 23.06.2019 13:00, dimondqueen511
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
image
Computers and Technology, 23.06.2019 14:00, ava5015
What is html ? give a small description about html
Answers: 2
Do you know the correct answer?
Please write in python: Week 1 (Print menu and take a selection)

At program start, you...

Questions in other subjects:

Konu
Social Studies, 20.10.2020 20:01
Konu
Biology, 20.10.2020 20:01