Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Exams Costs
- //Lee Slater
- //5.11.14
- GLOBAL password_code, no_of_tickets, cost_per_ticket, total_cost
- on mouseUp
- initialise _variables
- get_subjects_no
- calculate_cost
- display_cost
- end mouseUp
- on initialise _variables
- PUT "" INTO password_code //string
- PUT 0 INTO no_of_tickets //integer
- PUT 5.99 INTO cost_per_ticket //real
- PUT 0.00 INTO total_cost //real
- end initialise
- on get_ticket_no
- REPEAT UNTIL password_code="pa55ticket"
- ASK "Please enter your password code"
- IF the result = "cancel" THEN exit to top
- PUT it INTO password_code
- IF password_code <> "pa55ticket" THEN ANSWER "Sorry, wrong try again"
- PUT it INTO password_code
- end REPEAT
- ASK "how many tickets do you want to buy?"
- PUT it INTO no_of_tickets
- end get_ticket_no
- on calculate_cost
- PUT no_of_tickets*cost_per_ticket INTO total_cost
- end calculate_cost
- on display_cost
- SET numberformat TO "00.00"
- PUT "You are wanting"&&no_of_tickets&&"tickets"&RETURN AFTER field"output"
- PUT "The total cost is £"&total_cost &RETURN AFTER field "output"
- end display_cost
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement