Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. Global billItems, counter, bill, totalBill, itemType, randomBill
  2. ON mouseUp
  3. Setup_Variables
  4. Get_Items
  5. Check_Type
  6. Display_Bill
  7. end mouseUp
  8.  
  9. on Setup_Variables
  10. //Setup Variables
  11. Put 0 into billItems
  12. Put 0 into counter
  13. put 0 into bill
  14. put 0 into totalBill
  15. put "" into itemType
  16. Put 0 into randomBill
  17. end Setup_Variables
  18.  
  19. on Get_Items
  20. // Getting amount of items ordered
  21. Ask "How many bill items did you order?"
  22. Put it into billItems
  23. Put 1 into counter
  24. end Get_Items
  25.  
  26. On Get_Items
  27. repeat with loop = 1 to billItems
  28. Ask "What type of item did you order? (coffee = c, tea = t, biscuit = b)"
  29. Put it into itemType
  30. If ItemType = "c" then
  31. put (bill+2.25) into bill
  32. add 1 to counter
  33. else if itemType = "t" then
  34. put (bill+1.85) into bill
  35. add 1 to counter
  36. else
  37. put (bill+3.05) into bill
  38. add 1 to counter
  39. End IF
  40. end repeat
  41. end Get_Items
  42.  
  43. On Check_Type
  44. If counter <> billItems then
  45. Get_Items
  46. else
  47. Calculate_Bill
  48. end if
  49. end Check_Type
  50.  
  51. On Caulculate_Bill
  52. Put random(10) into randomBill
  53. If
  54. end Caulculate_Bill
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement