Guest User

Untitled

a guest
Jan 23rd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. item1 = int(input('Please input the price for your first item:' ))
  2. item2 = int(input('Please input the price for your next item:' ))
  3. item3 = int(input('Please input the price for your next item:' ))
  4. item4 = int(input('Please input the price for your next item:' ))
  5. item5 = int(input('Please input the price for your last item:' ))
  6. #These 5 lines take in the cost per item for 5 items. int causes the input to be taken in as an integer rather than a string and saves that integer into the variables "item1", "item2" and so on
  7.  
  8. subtotal = (item1 + item2 + item3 + item4 + item5) #This line takes the costs collected and adds them together then puts that total in the variable "subtotal"
  9. tax = subtotal * .06 #This line takes the subtotal and multiplies it by the tax ammount provided and puts that value into the variable "tax"
  10. total = subtotal + tax#This line adds the subtotal and the tax and puts that value into the variable "total"
  11.  
  12. print('Subtotal: ', subtotal)
  13. print('Tax (6%) : ', tax)
  14. print('Total: ', total)
  15. #These last 3 lines take the above variables and print them to the screen so that the user is able to see the subtotal, tax, and total of the 5 items
Add Comment
Please, Sign In to add comment