You are on page 1of 9

Scenario

For this Project, we have been tasked with creating a program for a theme park called
Fantasialand.

Decomposition
Use Tkinter to create a GUI with various user inputs, eg:
● Ticket purchase
● Number and detail of attending customer
● Tickets stored on a txt file with a random number assigned to each ticket. (Use
random module)
● Display each ticket purchased on the screen after each purchase

Strategy/Desired Outcomes

To make this program, I intend to use Tkinter to make screen designs, and use the entry
function to allow the user to input their own parameters within the GUI. Once they have
entered this, I intend to save all of this information to a text file. This means that I can
collect a database of purchases, for ease of access.

If the user has entered valid purchase details, based on the type and quantity of tickets, the
program will calculate the order price, and then display everything to the GUI. I intend to do
this using f strings, so that user defined variables can be entered into Tkinter’s “Label”
function. The user will then have the option to print the ticket, and copy the randomly
generated 4 digit security key to the clipboard
Design Option to
Save ticket Print ticket
to screen Search
to .csv file
record for
Start tickets

Option to
No print to
Purchase printer
tickets Is the
number
already
taken? Get random
User input: ticket
Type of number
Yes
Ticket

User input: Confirm


Ticket Purchase Show ticket price
quantity

Flowchart

Launch
Program
Pseudocode

Launch program

If Purchase ticket button pressed, then open purchase menu

User input: Enter Type of ticket

User input: Enter date of visit

User input: Enter number of visitor

If purchase is confirmed, show ticket price.

Else, return to menu

Show ticket price

Get random purchase ID

If random ID already exists on data base, get another ID.

Get random security key

If security key exists on database, get another key.

Save ticket to .csv file

Print ticket to screen

If Print ticket button is pressed, then print to printer.

If search record button is pressed, then

User Input, enter ticket ID

User Input enter security key

If security key is correct,

Show ticket to screen.

If print button is pressed, print to printer.


Ipso Table
INPUT PROCESS Storage OUTPUT
Type of Ticket Select price charged Store ticket type to Print price to screen
ticket csv file
Ticket Quantity Selects price charged Store ticket quantity Print ticket quantity to
to csv file screen
Confirm Purchase Proceeds to next Store ticket to csv file Shows next menu
menu
Option – Print to Prints ticket from csv Prints to screen and
printer file printer
Option – Search Asks for ticket number Input box print to
database for tickets and security code screen

Ticket number and Checks against data Stores access time and Prints ticket to screen
security code base if code is valid data to csv file

Data Dictionary

Variable Name Description Data type Formatting


Date_entry Date of visit String DD/MM/YYYY
Num_entry_var Holds number of Integer Number
adult tickets
purchased
child_entry_var Holds the number of Integer Number
child tickets
purchased
Security_ key Holds the 4 digit Integer 4 digit number
security code used
to access your ticket
Total Holds the price of Float Price in £
the complete
purchase
ID Holds a ticket Integer Sequential number
number, eg.
001,002,003
Child_price Holds the child Integer Number in £
ticket price-(£5)

Adult_price Holds the adult Integer Number in £


ticket price-(£10)

Implementation

Main GUI made using Tkinter of.


This allows you to start your
purchase.

Purchase Menu. This allows you


to enter the date of visit and the
number and type of ticket you
want to buy

Purchase Receipt. This shows


you all the purchase
information, as well as the
security code, which is randomly
generated. This can be copied to
the clipboard for later use
This allows the user to copy the security key to the clipboard, and is triggered
with a button, with the command “copy”.

This is the txt file that all purchases are saved to. This includes all the purchase
information, and is written to when the user submits their purchase.
Screen Design

This is the Main Gui menu. This includes the option to start your purchase.
This is the Ticket purchase menu. It allows you to enter the date of your visit,
the number of Adult tickets and the number of Child tickets. Once this is
complete, you can confirm the purchase.

This is the Ticket receipt menu. This shows all the user entered parameters, as
well as the price that the program has calculated. It will also generate an
original ticket ID, and a 4 digit security key. The first of the buttons will copy
the security key to the clipboard, and the second will take you back to the main
menu.
Evaluation

Overall, I feel like I have met the brief. I have created a program with a GUI
using Tkinter, which allows the user to specify date, ticket type, and quantity of
ticket you intend to purchase. The program also calculates the price, and
displays all the purchase parameters, including ticket ID and security code, and
saves them to a text file. To improve the program, I could add a search
function, which would allow the user to enter their Ticket ID, and the
corresponding security code, and have access to their visit information, with
the option to print to the printer. To make the code easier to read, I could add
comments, to allow anyone to easily understand what each bit of the code
does.

You might also like