Gallery
Lotto Ticket
Share
Explore
Lotto Ticket

icon picker
The Task

Activity: Lotto Ticket 🎫

Ticket System Needed!

Lotto would like a program that will go behind their ticketing app. To celebrate their launch all tickets will be £1. It should ask the user their age. Lotto have a strict age restriction in place, anyone under the age of 16 cannot buy a ticket. They want a check in place that will ask for the year the user is born. If they are younger than 16 an alert message will be displayed saying they are too young and they will not be able to purchase a ticket. If the user is old enough they will be asked how many tickets they would like to buy. For each ticket they would like to buy they will be asked to 5 pick different numbers. For each ticket it will display a ticket confirmation message with the ticket numbers along with the ticket cost.

Test Data

Age: 16
Number of tickets: 2

Sample Output

Ticket 1:

Pick your first number: 1
Pick your second number: 2
Pick your third number: 3
Pick your fourth number: 4
Pick your fifth number: 5

Processing Ticket...

LOTTO TICKET: CONFIRMATION
--------------------------------------
Numbers picked: 1, 2, 3, 4, 5
--------------------------------------


Ticket 2:

Pick your first number: 9
Pick your second number: 8
Pick your third number: 7
Pick your fourth number: 6
Pick your fifth number: 5

Processing Ticket...

LOTTO TICKET: CONFIRMATION
--------------------------------------
Numbers picked: 9, 8, 7, 6, 5
--------------------------------------


LOTTO TICKET: Ticket costs
--------------------------------------
You have bought 2 this will be £2.0
--------------------------------------

Start Here

Write your pseudocode for this program in the pseudocode.md file.
Copy over your pseudocode into main.py and turn these into comments.
Use code clips to get the code needed.

Remember

Break the problem into small chunks!

Don’t try to do the whole program and then test it. Pick the bits that are easy to do first and get them working. This might not be the part of the program at the start. Test the program once that is working move onto another line and repeat.

You do not need to memorise any of the code!

Even the best programmers need to look up commands and the more you use the commands the more familiar they will become.

Everyone gets bugs!🐞

Even the most experienced programmers make mistakes. Try to fix one error at a time.
Good luck! 🍀
Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.