Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Global billItems, counter, bill, totalBill, itemType, randomBill
- ON mouseUp
- Setup_Variables
- Get_Items
- Check_Type
- Display_Bill
- end mouseUp
- on Setup_Variables
- //Setup Variables
- Put 0 into billItems
- Put 0 into counter
- put 0 into bill
- put 0 into totalBill
- put "" into itemType
- Put 0 into randomBill
- end Setup_Variables
- on Get_Items
- // Getting amount of items ordered
- Ask "How many bill items did you order?"
- Put it into billItems
- Put 1 into counter
- end Get_Items
- On Get_Items
- repeat with loop = 1 to billItems
- Ask "What type of item did you order? (coffee = c, tea = t, biscuit = b)"
- Put it into itemType
- If ItemType = "c" then
- put (bill+2.25) into bill
- add 1 to counter
- else if itemType = "t" then
- put (bill+1.85) into bill
- add 1 to counter
- else
- put (bill+3.05) into bill
- add 1 to counter
- End IF
- end repeat
- end Get_Items
- On Check_Type
- If counter <> billItems then
- Get_Items
- else
- Calculate_Bill
- end if
- end Check_Type
- On Caulculate_Bill
- Put random(10) into randomBill
- If
- end Caulculate_Bill
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement