Question: please use python to finish this program! thanks PROBLEM: CHOCOLATE PURCHASE The local store offers 3 kinds of chocolates - dark, milk, and white. The
please use python to finish this program! thanks
PROBLEM: CHOCOLATE PURCHASE The local store offers 3 kinds of chocolates - dark, milk, and white. The price of dark chocolate is $1.90 per piece, the price of milk chocolate is $1.70 per piece, and the price of white chocolate is $2.00 per piece. If you buy more than 12 pieces of chocolate (total of any kind) you get the discount 15 percent. You also need to pay a state tax 10.1 percent (if you get a discount, the tax is applied on discounted amount of the purchase). Write a program that asks the user to enter the number of pieces of chocolate to buy for each kind of chocolate and then displays: The total purchase amount (in dollars); The discount amount (in dollars) The state tax to pay (in dollars) The total price to pay for chocolates (in dollars) Specification The program should use the main function for getting inputs from the user. . The program should use the function chocolate to calculate and to display the purchase amount, the discount, tax, and the total. The numbers of pieces of chocolates should be used as arguments . Prices of chocolates and the percentage of the discount should be used as global variables. All amounts should be showed as dollars rounded to two decimal places. . PROBLEM: CHOCOLATE PURCHASE The local store offers 3 kinds of chocolates - dark, milk, and white. The price of dark chocolate is $1.90 per piece, the price of milk chocolate is $1.70 per piece, and the price of white chocolate is $2.00 per piece. If you buy more than 12 pieces of chocolate (total of any kind) you get the discount 15 percent. You also need to pay a state tax 10.1 percent (if you get a discount, the tax is applied on discounted amount of the purchase). Write a program that asks the user to enter the number of pieces of chocolate to buy for each kind of chocolate and then displays: The total purchase amount (in dollars); The discount amount (in dollars) The state tax to pay (in dollars) The total price to pay for chocolates (in dollars) Specification The program should use the main function for getting inputs from the user. . The program should use the function chocolate to calculate and to display the purchase amount, the discount, tax, and the total. The numbers of pieces of chocolates should be used as arguments . Prices of chocolates and the percentage of the discount should be used as global variables. All amounts should be showed as dollars rounded to two decimal places
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
