As input for program receipt, a cashier enters in the data for each of the customer’s purchases. Each data group consists of an item name, the price of the item, and the quantity of that item being purchased. The data sentinel xyz is used instead of an item name. Here is the screen display for a typical run that would also produce a sales receipt.
Enter item name or xyz to stop pencil
Enter price per item 2.5
Enter the quantity 3
The price is RM 7.50
Enter item name or xyz to stop scissors
Enter price per item 3
Enter the quantity 2
The price is RM 6.0
Enter item name or xyz to stop xyz
This is what I have come with so far!
item_Name = raw_input("Enter the name of Item: ") price = input("Enter the Price: ") quantity = input("Enter the Quantity: ") count=0 print "Price for ",quantity,item_Name," is ",price*quantity,"RM" q = raw_input("Would you like to continue with the operation?(Y/N) " while q = "Y" or "y": q = count + 1 elif q = "N" or "n": print "Operation has ended, Press Enter to exit" raw_input("")
This post has been edited by Wannabehacker: 01 September 2010 - 08:45 AM