#The person is purchasing apples and apple pies in the store. Write the #program that reads the number of pounds and price per pound for apples, #the number of pies and price of one pie, and the tax (integer). The #program finds and prints the total purchase price. For example, if the #person purchased 3 pounds of apples, 1.99 per pound, and 2 apple pies, #7.99 each, and the tax is 6%, the total purchase price is: 23.27 dollars. #Discussion #Input: apple_pound (float), apple_price (float), num_pie (int), pie_price #(float), tax (int). Limitations: all prices>0, apple_pound>=0, #num_pie>=0, tax>=0 #Calculations: total=(apple_pound*apple_price + num_pie*pie_price)*(1+tax/100) #The longer formula will be: apple_pound*apple_price + num_pie*pie_price + #(apple_pound*apple_price + num_pie*pie_price)*tax/100 #Using the rule: a*(b+c)=a*b+a*c #Output: total - float, limitation, total>=0 #Input apple_pound=float(input("enter number of pounds ")) apple_price=float(input("enter price of apples per pound ")) num_pie=int(input("enter number of pies ")) pie_price=float(input("enter price of pie ")) tax=int(input("enter tax as an integer percent ")) #Calculations and Outputs #Step 1 - validity of the input validity = apple_pound>=0 and apple_price>0 and num_pie>=0 and pie_price>0 and tax>=0 if(validity == True): total=(apple_pound*apple_price + num_pie*pie_price)*(1+tax/100) print("total amount is",format(total, '.2f')) else: print("invalid input")