subject

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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:30
To insert a column without using commands in any tabs, a user can -click and then click insert column.
Answers: 3
question
Computers and Technology, 22.06.2019 12:10
Linux is distributed under gnu gpl. why is this important? a. it ensures that only torvalds can profit from the sale of linux b. it prevents unknowledgeable users from downloading programs they don't know how to operate. c. it provides protection for the developers who created linux. d. it states that anyone can copy, modify, and share the program if changes are made public.
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
Answers: 1
question
Computers and Technology, 24.06.2019 08:50
Write a program that will compute the volume of ice cream served in a cone. as you can see in the diagram below, the ice cream is served as a hemisphere of frozen deliciousness on top of a cone, which is also packed with frozen deliciousness. thus, the total volume of ice cream sold is the volume of the hemisphere plus the volume of the cone. the example shows an ice cream cone in which the hemisphere and cone have a radius of 10 inches and the cone has a height of 15 inches. your program must instead prompt for these two values, which are taken from the keyboard as integers: • the hemisphere/cone radius in inches, and
Answers: 3
You know the right answer?
Please write in python: Week 1 (Print menu and take a selection)

At program start, you...
Questions
question
Mathematics, 31.01.2020 18:53
question
Mathematics, 31.01.2020 18:54
Questions on the website: 13722361