0% found this document useful (0 votes)
191 views72 pages

CSC 126 Project Report

Uploaded by

xxaimeenshafiq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
191 views72 pages

CSC 126 Project Report

Uploaded by

xxaimeenshafiq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 72

PROJECT REPORT

FACULTY
SCHOOL OF COMPUTING AND MATHEMATICS
PROGRAME
DIPLOMA IN COMPUTER SCIENCE (CS110)

SUBJECT/CODE/CLASS
FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
CSC126
JCDCS1101D

PROJECT TITLE
CINEMA TICKETING SYSTEM

PREPARED FOR:
MADAM NOR FAUZIAH BINTI ABU BAKAR

PREPARED BY:
MUHAMMAD AIMEEN SHAFIQ BIN MOHD SHAFARIN(2023862888)
MUHAMMAD IRSYAD RAMLI(2023478798)
GIENA QHALILLA BINTI MOHD.HAFIDZ(2023467036)
SYAZA SYAZWANA BINTI ROSDIE(2023457048)
2
TABLE OF CONTENTS

1. PROJECT SUMMARY 3
0
2. OBJECTIVE OF PROJECT 4
0
3. DESIGN ALGORITHM – FLOWCHART & PSEUDOCODE 5-38
0
4. SOURCE CODE 38-66
0
5. SAMPLE OF OUTPUT 67-70
0
6. DISCUSSION/CONCLUSION 70
0

3
1.0 PROJECT SUMMARY
In summary, the Cinema Ticketing System is a powerful and intuitive software program that
streamlines and automates the movie ticket booking, buying, and management process in a
theatre setting. The technology is designed to guarantee smooth operations and effective
ticket sales, improving the whole moviegoing experience for patrons and theatre employees.
The Cinema Ticketing System with Food Package Integration aims to revolutionize the
cinema industry by providing a holistic solution that caters to the entertainment and dining
needs of patrons, offering a complete and enjoyable cinematic experience. Furthermore, all
services are rendered online in this day and age of modernity. Customers will thus receive
the feedback promptly. It is evident that this technique works very well in saving consumers'
time when they don't have to wait in line to purchase tickets at the counter.
Other than that , we create the responsive interface accessible across various
devices for a broad user base. This will give the user the best experience while using our
user-friendly program . In this system, customers are required to registered to an account by
using their email or phone number. As a user and customers , they can choose to choose
and watch variety of movies that are already programmed as we provide dynamic scheduling
of movie showtimes with flexibility for updates. They can also choose the location of the
cinema as every cinema are included into this system. Clients can make reservations by
choosing the type of hall they want as there are variety of halls provided.
We also create an Admin Dashboard in this program for theatre administrators to
handle movie lists, showtimes, ticket sales, and food package inventory. There are also
reporting tools for monitoring the success of both theatre and food services, so that any
change in movie, ticket price, or movie schedule can be managed conveniently and, most
importantly, without error. This will provide a positive customer experience by integrating
movie and food.
In addition , we also gives customers an option to customize food packages,
including snacks and beverages, during the booking process. A few discounts are available
such as students discount, senior citizen discount and also children discount. Each cinema
also provides a special promotion on every public holiday.
Last but not least , customers are given an options to make a payment either online
payment using card or cash at counter . For online payment , customers should not hesitate
and worried because our program comes with a secure transactions for both movie tickets
and food packages. Payment that made by online at the website, will get a reward point that
can be collected by users and they can redeem a ticket when the points collected reach the
maximum. Ticket price will include 6% of tax and for the customers who pay by online will be
charge RM1 for the service charge.
The Movie Ticketing System with its integrated food package functionality has the
potential to revolutionize the cinema industry. By providing a seamless and enjoyable
experience for patrons, and offering cinema administrators powerful tools for efficient
operations, this system sets the stage for a new era in cinema management and customer
satisfaction.

4
Table 1 showing movie prices :

Movie Movie Title Classification Screen Price Adult Price Price


Id quality Children Senior/OKU
1 Interstellar PG13 Norma RM 21 RM 17 RM 11
l
Imax + RM 4
3D + RM 5
2 Oppenheimer R18 Norma RM 21 RM 11
l
Imax + RM 4
3D + RM 5
3 Sijjin 16 Norma RM 21 RM 11
l
Imax + RM 4
3D + RM 5
4 La La Land PG13 Norma RM 21 RM 17 RM 11
l
Imax + RM 4
3D + RM 5

Table 1.1 showing special discount:

SPECIAL DISCOUNT PRICE


Calling All Students Discount RM11
( Monday – Friday )
OKU RM11

Chinese New Year Adults : RM20


Kids : RM15
Eid Al-Fitr Adults : RM20
Kids : RM15
Deepavali Adults : RM20
Kids : RM15
National Day Adults : RM20
Kids : RM15
Malaysia Day Adults : RM20
Kids : RM15
Christmas Day Adults : RM20
Kids : RM15

5
Table 1.2,1.3 show assortment of food and drink :

COMBO SNACK PRICE


A] 1x POPCORN (M), 1x SOFT DRINK or MINERAL WATER RM5.50
B] 1x POPCORN (L), 1x SOFT DRINK or MINERAL WATER RM7.50
C] 1x POPCORN (S), 2x SOFT DRINK or MINERAL WATER, 1x RM15.00
CHICKEN NUGGET (6PCS)
D] 1x POPCORN (S), 2x SOFT DRINK or MINERAL WATER, 1x RM12.00
HOTDOG
E] 1x CHICKEN NUGGET (6PCS), 1x SOFT DRINK or RM10.00
MINERAL WATER
F] 1x HOT DOG, 1x SOFT DRINK or MINERAL WATER RM7.50
G] 1x RED VELVET or CHOCOLATE POPCORN, 1x SOFT RM11.00
DRINK or MINERAL WATER
H] 1x SAUSAGES (8PCS), 1x SOFT DRINK or MINERAL RM11.50
WATER
ADD-ONS PRICE
1) FRIES (S) RM3.00 EACH
2)POPCORN IN A CUP
3)SAUSAGES (5PCS)
4)HOTDOG RM5.00 EACH
5)CHICKEN NUGGET (5PCS)
6)MEATBALLS (5PCS)

FOOD & DRINKS PRICE


1)POPCORN ORIGINAL (S) or (M) RM3.50/RM4.50
2)POPCORN CARAMEL (S) or (M) RM4.50/RM5.50
3)POPCORN RED VELVET (S) or (M) RM7.50/RM8.50
4)POPCORN CHOCOLATE (S) or (M) RM7.50/RM8.50
5)CHICKEN NUGGET (S) or (M) RM7.50/RM12.50
6)SAUSAGES (S) or (M) RM7.00/RM8.00
7)HOT DOG (S) or (M) RM5.50/RM6.50
8)FRIES (S) or (M) RM5.50/RM 6.50
9)SOFT DRINK (S) or (M) RM 3.10/RM3.50
10)MINERAL WATER RM2.50
11)HOT/ICED TEA RM3.50/RM4.00
12)HOT/ICED LATTE RM3.50/RM4.00
13)HOT/ICED CHOCOLATE RM4.00/RM 4.50
14)HOT/COLD WHITE COFFEE RM4.00/RM 4.50

6
15)HOT/ICED MILO RM4.00/RM4.50

2.0 OBJECTIVE

 CALCULATION
To calculate all the selected goods and services from the user and applied discount
to be paid.

 HIGHEST & MINIMUM


To allow admin to see the highest and lowest amount of spending of a customer.

 DISPLAY
To display useful information like prices, movie tickets and food combos that is
available to the user.

 RECORD
To record all the user username and password login for registration.

 AVERAGE
To find the average spending of each customer.

 OUTPUT
To output total price after calculating the price of movie, food combos and applying
discount.

7
programSelection ← 0

selection ← 0

customerCount ← 0

totalSales ← 0

totalTicket ← 0

movieID ← 0

movie1 ← "Interstellar"

movie2 ← "Oppenheimer"

movie3 ← "Sijjin"

movie4 ← "La La Land"

movieQlty ← " "

movieTime ← " "

3.0 DESIGN ALGORITHM date ← " "

3.1 FLOWCHART showtime ← " "

hall ← 0

main function adultNum ← 0

Start
childNum ← 0

username ← " "


seniorNum ← 0

pass ← " "


qltyPrice ← 0

newUsername ← " "


ticketPrice ← 0

newPass ← " "


codeChange ← 0

user[100] ← 0
qualityPrice ← 0
password[100] ← 0
foodPrice ← 0
i ← 1

o ← 1
A
totalSnackPrice ← 0

totalComboPrice ← 0
answer ← 0

addon ← 0
check ← False

totalAddonPrice ← 0
programSelection ← 0

totalAmount ← 0
selection ← 0

totalPrice ← 0
customerCount ← 0

totalSales ← 0 totalDiscount ← 0

totalTicket ← 0 adminPass ← 2005

movieID ← 0 enteredCode ← 0

movie1 ← "Interstellar" adminOpt ← 0

movie2 ← "Oppenheimer" promoCode ← 2005

movie3 ← "Sijjin"
movieChange ← 0

movie4 ← "La La Land"


tax ← 0.06

movieQlty ← " "


name ← " "

movieTime ← " "


ic ← " "

date ← " "


eWalletPin ← 0

showtime ← " "


cardPin ← " "
hall ← 0
cardCVV ← 0
adultNum ← 0

cardExpiration ← 0
childNum ← 0

paymentMethod ← " "


seniorNum ← 0

specialDisc ← 0
qltyPrice ← 0

discount ← 0
ticketPrice ← 0

discountEvent ← 0
codeChange ← 0

discountType ← " "


qualityPrice ← 0

foodPrice ← 0 confirmation ← false

totalSnackPrice ← 0 highest ← 0

totalComboPrice ← 0 lowest ← 10000

addon ← 0
8 Loop

totalAddonPrice ← 0 Yes
programSelection = 1
No
totalAmount ← 0

Loop
totalPrice ← 0
cardCVV ← 0

cardExpiration ← 0

paymentMethod ← " "

specialDisc ← 0

discount ← 0

discountEvent ← 0

8
discountType ← " " A
confirmation ← false

7
highest ← 0

lowest ← 10000

Loop

10 Yes
programSelection = 1
No

Loop

elect one: 1.Register 2.Login 3.Admin" GET answer

Yes No
answer == 1

Yes No
Loop answer == 2

Yes No
registration(newUsername, newPass) Loop answer == 3

user[i] ← newUsername
login(username, pass) Loop

password[i] ← newPass
o←1
"Enter the admin password :"GET enteredCode

i ←i + 1
Loop Yes
enteredCode== adminPass

No
PUT "Registration sucessful!"¶
Yes
((username == user[o])&&(pass==password[o]))
PUT "Incorrect"¶
No
answer ← 2

o←o + 1
Yes
answer == 2
PUT "Welcome to the Admin System"¶
No

check ← True PUT "Total site visitor today :"+customerCount¶

Yes
check != true PUT "Total ticket sold today is :"+totalTicket¶
No

PUT "Total sales today is :RM"+totalSales¶

PUT "The average spending is: RM"+totalSales/customerCount¶

PUT "The highest customer spent : RM"+highest¶

PUT "The lowest customer spent :RM"+lowest¶

"What to change? 1.Promocode 2.Movie available 3.Admin code 99.Log out"GET codeChange

Yes No
adminOpt == 1

Yes No
"Enter the new promoCode : "GET promoCode adminOpt == 2

PUT "Sucessful, the new code is : "+promoCode¶ Yes


adminOpt == 3
No
"Enter the movieID you want to change 1-4 : "GET movieID

Yes No
movieID == 1
"Enter the new promoCode : "GET adminPass

Yes No
"Enter the new movie name : "GET movie1 movieID == 2 PUT "Sucessful, the new code is : "+adminPass¶

PUT "The new movie is : "+movie1¶ Yes


movieID == 3
No
"Enter the new movie name : "GET movie2

PUT "The new movie is : "+movie2¶ Yes


movieID == 4
No
"Enter the new movie name : "GET movie3

PUT "The new movie is : "+movie3¶


"Enter the new movie name : "GET movie4

PUT "The new movie is : "+movie4¶

9
Yes
check == true
No

Loop

Loop
Yes No
movieID == 1

Yes No
"Enter the new movie name : "GET movie1 movieID == 2

PUT "The new movie is : "+movie1¶ Yes


"Enter the new movie name : "GET movie2

PUT "The new movie is : "+movie2¶


"Enter the new movie name : "G

PUT "The new movie is : "+m

9 Yes
8
check == true
9
No

Loop

Loop

"Please select a movie you want to watch : 1.Interstellar/2.Oppenheimer/3.Sijjin/4.La la Land"GET movieID

Yes No
movieID = 1

Yes No
movieChoice ← movie1 movieID = 2

Yes No
movieChoice ← movie2 movieID = 3

Yes No
movieChoice ← movie3 movieID = 4

movieChoice ← movie4 PUT "Invalid movie ID"¶

movieID ← 0

Yes
movieID != 0

No

Loop

"Please select movie quality normal/3d/imax"GET movieQuality

Yes No
movieQlty == "normal"

Yes No
qualityPrice ← 0 movieQlty == "3d"

Yes No
qualityPrice ← 4 movieQlty == "imax"

qualityPrice ← 5 PUT "Incorrect movie type"¶

movieQlty ← "invalid"

Yes
movieQuality != "invalid"

No

Loop

"Enter number of adult : "GET adultNum

"Enter number of child : "GET childNum

"Enter number of senior ; "GET seniorNum

Yes
(qtyAdult >= 0)||(qtyChild>=0)||(qtySenior>=0)

No

foodMenu()

snackSelect(totalSnackPrice)

foodCombo()

comboSelect(totalComboPrice)

Loop

"Do you want to addon? 99 - NO // 1 - Fries 2 - Sodas 3 - Nuggets 4 -Hotdogs ,5 - Chickens 6 - Meatballs : "GET snackAddon

Yes
snackAddon = 99

No

Yes No
(snackAddon ==1)||(snackAddon =2)||(snackAddon =3)

Yes No
addonPrice ← addonPrice + 3.00 (snackAddon =4)||(snackAddon =5)||(snackAddon =6)

addonPrice ← addonPrice + 5.00

"Enter the date : "GET date

Loop

"Enter show time (10:00,14:00,16:00,18:00,21:00)"GET showtime


10
(showtime != "10:00")Yes
|| (showtime != "14:00") ||( showtime != "16:00") || (showtime != "18:00 ")|| (showtime != "21:00")

No

intPromoCode(promocode, discount)
No

Yes No
(snackAddon ==1)||(snackAddon =2)||(snackAddon =3)

Yes No
addonPrice ← addonPrice + 3.00 (snackAddon =4)||(snackAddon =5)||(snackAddon =6)

addonPrice ← addonPrice + 5.00

"Enter the date : "GET date

Loop

"Enter show time (10:00,14:00,16:00,18:00,21:00)"GET showtime

Yes
(showtime != "10:00") || (showtime != "14:00") ||( showtime != "16:00") || (showtime != "18:00 ")|| (showtime != "21:00")
9
10
No

intPromoCode(promocode, discount) 9
10
"Are you a student? Y - Yes / N - No "GET student

"Are you a holder of OKU card? Y - Yes / N - No"GET oku

Yes No
(student == "Y")||(student=="y")

specialDisc ← 5 specialDisc ← 0

discountType ← "Student" discountType ← "NONE"

Yes No
(oku == "Y")||(oku=="y")

specialDisc ← 5 specialDisc ← 0

discountType ← "OKU" discountType ← "NONE"

Loop

Yes
confirmation == true

No

"Enter payment method A - eWallet B- Debit Card : "GET paymentMethod

Yes No
paymentMethod == "A"

Yes No
"Enter your name :"GET name paymentMethod == "B"

"Enter your IC : "GET ic


"Enter your name :"GET name

"Enter your eWallet Pin : "GET eWalletPin


"Enter your IC : "GET ic

confirmation ← true
"Enter your card pin ; "GET cardPin

"Enter your card CVV : "GET cardCVV

"Enter your card expiration date ; "GET cardExpiration

confirmation ← true

PUT "Selected Movie : "+movieChoice¶

PUT "Movie Quality : " + movieQlty¶

PUT "Selected Date : "+date¶

PUT "Selected Show Time : "+showTime¶

PUT "Hall Number : "+hall¶

PUT "Discount Type : "+discountType¶

PUT "Event Special Discount : "+ discountEvent¶

calcTicketPrice(qltyPrice, adultNum, childNum, seniorNum, ticketPrice)

calcFoodPrice(totalSnackPrice, totalComboPrice, totalAddonPrice, foodPrice)

calcTotalAmount(ticketPrice, foodPrice, specialDisc, discount, totalAmount, tax)

totalDiscount ← (totalAmount * discount) + specialDisc

PUT "Total Ticket Price : RM"+ticketPrice¶

totalPrice ← totalAmount - totalDiscount

PUT "Total Food & Beverage Price :RM"+foodPrice¶

PUT "TotalPprice after 6% GST: RM"+totalAmount¶

PUT "Total Discount : RM"+totalDiscount¶

PUT "Total Price is :RM"+totalPrice¶

totalTicket ← qtyAdult + qtyChild + qtySenior

totalSales ← totalSales + totalAmount

"Choose one : 1.Log Off 2.Book Another"GET selection

Yes
selection == 1

No

customerCount ← customerCount + 1

Yes No
totalAmount > highest

highest ← totalAmount

Yes
totalAmount < lowest
No
11
lowest ← totalAmount

"Do you want to stop the program? 1.Yes 2.No"GET programSelection


8
8
promocode function Registration function

Start (in promoCode, out discount)

enterPromo ← " " Start (in out newUsername, in out newPassword)

"Enter a promo code if you have it :"GET enterPromo


"Enter your new username :"GET newUsername

Yes No
enterPromo == promoCode

"Enter your new password : "GET newPassword

discount ← 0.1 discount ← 0


End

End

calcTicketPrice function Login function

Start (in out username, in out pass)

Start (in ticketPrice, in foodPrice, in specialDisc, in discount, out totalAmount, in tax)


"Enter your username :"GET username

totalAmount ← ((ticketPrice + foodPrice) - ((ticketPrice + foodPrice) * discount)) - specialDisc


"Enter your password : "GET password

totalAmount ← totalAmount + (totalAmount * tax)


End

End

Movie Quality price function


totalSnackPrice function

Start (in qltyPrice, in adultNum, in childNum, in seniorNum, out ticketPrice)

Start (in totalSnackPrice, in totalComboPrice, in totalAddonPrice, out foodPrice)


ticketPrice ← 0

foodPrice ← totalAddonPrice + totalComboPrice + totalSnackPrice


ticketPrice ← (adultNum * (21 + qltyPrice)) + (childNum * (17 + qltyPrice)) + (seniorNum * (11 + qltyPri

End
End

12
Food menu function

Start ()

PUT "Cinema Food and Beverages Menu"¶

PUT "1)POPCORN ORIGINAL (S) or (M)"¶ Combo menu function

PUT "2)POPCORN CARAMEL (S) or (M)"¶ Start ()

PUT "A] 1x POPCORN (M), 1x SOFT DRINK or MINERAL WATER :RM5.50"¶


PUT "3)POPCORN RED VELVET (S) or (M)"¶

PUT "B] 1x POPCORN (L), 1x SOFT DRINK or MINERAL WATER : RM7.50"¶


PUT "4)POPCORN CHOCOLATE (S) or (M)"¶

PUT "C] 1x POPCORN (S), 2x SOFT DRINK or MINERAL WATER, 1x CHICKEN NUGGET (6PCS) : RM15.00"¶

PUT "5)CHICKEN NUGGET (S) or (M)"¶


PUT "D] 1x POPCORN (S), 2x SOFT DRINK or MINERAL WATER, 1x HOTDOG : RM12.00"¶

PUT "6)SAUSAGES (S) or (M)"¶


PUT "E] 1x CHICKEN NUGGET (6PCS), 1x SOFT DRINK or MINERAL WATER : RM10.00"¶

PUT "7)HOT DOG (S) or (M)"¶ PUT "F] 1x HOT DOG, 1x SOFT DRINK or MINERAL WATER : RM7.50"¶

PUT "8)FRIES (S) or (M)"¶ PUT "G] 1x RED VELVET or CHOCOLATE POPCORN, 1x SOFT DRINK or MINERAL WATER : RM11.00"¶

PUT "H] 1x SAUSAGES (8PCS), 1x SOFT DRINK or MINERAL WATER : RM11.50"¶


PUT "9)SOFT DRINK (S) or (M)"¶

End

PUT "10)MINERAL WATER"¶

PUT "11)HOT/ICED TEA"¶

PUT "12)HOT/ICED LATTE"¶

PUT "13)HOT/ICED CHOCOLATE"¶

PUT "14)HOT/COLD WHITE COFFEE"¶

PUT "15)HOT/ICED MILO"¶

End

13
Combo select function

Start (out totalComboPrice)

comboPrice ← 0

comboQty ← 0

comboCode ← " "

Loop

"Enter the letter of the combo A-H, (N) to stop "GET comboCode

Yes No
combo == "A"

Yes No
comboPrice ← comboPrice + 5.50 combo == "B"

"Enter quantity"GET comboQty Yes


combo == "C"
No
comboPrice ← comboPrice + 7.50

"Enter quantity"GET comboQty Yes


combo = "D"
No
comboPrice ← comboPrice + 15.00

"Enter quantity"GET comboQty Yes


combo == "E"
No
comboPrice ← comboPrice + 12.00

"Enter quantity"GET comboQty Yes


combo == "F"
No
comboPrice ← comboPrice + 10.00

"Enter quantity"GET comboQty Yes


combo == "G"
No
comboPrice ← comboPrice + 7.50

"Enter quantity"GET comboQty Yes


combo == "H"
No
comboPrice ← comboPrice + 11.00

"Enter quantity"GET comboQty Yes


comboCode == "N" || comboCode == "n"
No
comboPrice ← comboPrice + 11.50

"Enter quantity"GET comboQty


PUT "Invalid Code"¶

Yes
comboCode == "N" || comboCode == "n"

No

totalComboPrice ← totalComboPrice + (comboPrice * comboQty)

End

14
Start (out totalSnackPrice) snackSelect function
snackCode ← 0

snackPrice ← 0

snackSize ← " "

"Enter food and drink code, 1 to 15 , 99 to Stop :"GET snackCode

Yes No
snackCode = 1

Yes No
"What size do you want? (S) or (M) :"GET snackSize snackCode = 2

Yes No
snackSize == "S" Yes No
"What size do you want? (S) or (M) :"GET snackSize (snackCode = 3)||(snackCode = 4)

Yes No Yes No
snackPrice ← snackPrice + 3.50 snackSize = "M" snackSize == "S" Yes No
"What size do you want? (S) or (M) :"GET snackSize snackCode = 5

Yes No Yes No
snackPrice ← snackPrice + 4.50 PUT "Invalid Input"¶ snackPrice ← snackPrice + 4.50 snackSize = "M" snackSize == "S" Yes No
"What size do you want? (S) or (M) :"GET snackSize snackCode = 6
B
Yes No Yes No
snackPrice ← snackPrice + 5.50 PUT "Invalid Input"¶ snackPrice ← snackPrice + 7.50 snackSize = "M" snackSize == "S"
"What size do you want? (S) or (M) :"GET snackSize

Yes No Yes No
snackPrice ← snackPrice + 8.50 PUT "Invalid Input"¶ snackPrice ← snackPrice + 7.50 snackSize = "M" snackSize == "S"
"What size do you want? (S) or (M) :"GET s

Yes No Yes No
snackPrice ← snackPrice + 12.50 PUT "Invalid Input"¶ snackPrice ← snackPrice + 7.00 snackSize = "M" snackSize == "S"

snackPrice ← snackPrice + 8.00 PUT "Invalid Input"¶ snackPrice ← snackPrice + 5.50

snackPrice ←

C
totalSnackPrice ← totalSnackPrice + snackPrice

End
Yes
B
snackCode = 6
No

Yes No
(snackCode = 7)||(snackCode = 8)

Yes No
"What size do you want? (S) or (M) :"GET snackSize snackCode = 9

o Yes No
snackSize == "S" Yes No
"What size do you want? (S) or (M) :"GET snackSize snackCode = 10

Yes No Yes No
T "Invalid Input"¶ snackPrice ← snackPrice + 5.50 snackSize = "M" snackSize == "S" Yes No
snackPrice ← snackPrice + 2.50 (snackCode = 11)||(snackCode = 12)

Yes No
snackPrice ← snackPrice + 6.50 PUT "Invalid Input"¶ snackPrice ← snackPrice + 3.10 snackSize = "M" Yes No
"What do you want? (H) or (C) :"GET snackSize (snackCode = 13)||(snackCode = 14)||(snackCode = 15)

Yes No
snackPrice ← snackPrice + 3.50 PUT "Invalid Input"¶ snackSize == "H" Yes No
"What size do you want? (S) or (M) :"GET snackSize snackCode == 99

Yes No Yes No
snackPrice ← snackPrice + 3.50 snackSize = "C" snackSize == "H"
PUT "Invalid snack code"¶

Yes No
snackPrice ← snackPrice + 4.00 PUT "Invalid Input"¶ snackPrice ← snackPrice + 4.00 snackSize = "C"

15 snackPrice ← snackPrice + 4.50 PUT "Invalid Input"¶


C

3.2 Pseudocode
Start

//function to calculate total amount


Function calcTotal(num ticketPrice,num foodPrice,num
specialDisc,num discount)
totalAmount = (ticketPrice + foodPrice) - ((ticketPrice +
foodPrice)*(specialDisc+discount))
return totalAmount
endfunction

//function to prompt and read username & password


function registration(string &username,string &password)
prompt"Enter your new username"
read username
prompt"Enter your new password"
read password
endfunction

function login(string &username,string &password)


prompt"Enter your username"
read username
prompt"Enter your password"
read password
endfunction

//function for food and combo selection


function snackSelect(totalSnackPrice)

16
num snackCode = 0
prompt "Enter the food and drink code you want 1 to 15"
while(snackCode!=99)
read snackCode
if snackCode == 1
prompt "what size do you want? (S) or (M) :"
13
do
read snackSize
if snackSize == 'S' Do
snackPrice += 3.50
else if snackSize == 'M' Do
snackPrice += 4.50
else display "Invalid Input",snackPrice
= -1
Endif
while(snackPrice != -1)
Endwhile
else if snackCode == 2
prompt "what size do you want? (S) or (M) :"
do
read snackSize
if snackSize == 'S' Do
snackPrice += 4.50
else if snackSize == 'M' Do
snackPrice += 5.50
else display "Invalid Input",snackPrice
= -1
Endif
while(snackPrice != -1)
Endwhile
else if snackCode == 3 || 4 Do
prompt "what size do you want? (S) or (M) :"
do
read snackSize

17
if snackSize == 'S' Do
snackPrice += 7.50
else if snackSize == 'M' Do
snackPrice += 8.50
else display "Invalid Input",snackPrice
= -1
14
Endif
while(snackPrice != -1)
Endwhile
else if snackCode == 5 Do
prompt "what size do you want? (S) or (M) :"
do
read snackSize
if snackSize == 'S' Do
snackPrice += 7.50
else if snackSize == 'M' Do
snackPrice += 12.50
else display "Invalid Input",snackPrice
= -1
Endif
while(snackPrice != -1)
Endwhile
else if snackCode == 6 Do
prompt "what size do you want? (S) or (M) :"
do
read snackSize
if snackSize == 'S' Do
snackPrice += 7.00
else if snackSize == 'M' Do
snackPrice += 8.00
else display "Invalid Input",snackPrice
= -1
Endif
while(snackPrice != -1)

18
Endwhile
else if snackCode == 7 || 8 Do
prompt "what size do you want? (S) or (M) :"
do
read snackSize
if snackSize == 'S' Do
snackPrice += 5.50
else if snackSize == 'M' Do
snackPrice += 6.50
else display "Invalid Input",snackPrice
= -1
Endif
while(snackPrice != -1)
Endwhile
else if snackCode == 9 Do
prompt "what size do you want? (S) or (M) :"
do
read snackSize
if snackSize == 'S' Do
snackPrice += 3.10
else if snackSize == 'M' Do
snackPrice += 3.50
else display "Invalid Input",snackSize =
'I'
Endif
while(snackSize != 'I')
Endwhile
else if snackCode == 10 Do
snackPrice += 2.50
else if snackCode == 11||12 Do
prompt "Do you want it Hot or Cold? (H) or
(C) :"
do
read snackSize
if snackSize == 'H' Do

19
snackPrice += 3.50
else if snackSize == 'C' Do
snackPrice += 4.00
else display "Invalid Input",snackPrice
= -1
Endif
while(snackPrice != -1)
Endwhile
else if snackCode == 13||14||15 Do
prompt "Do you want it Hot or Cold? (H) or
(C) :"
do
read snackSize
if snackSize == 'H' Do
snackPrice += 4.00
else if snackSize == 'C' Do+
snackPrice += 4.50
else display "Invalid Input",snackPrice
= -1
Endif
while(snackPrice != -1)
Endwhile
else
if(snackCode == 99)
break
else
display "Invalid Food Code"
Endif
Endif
prompt "Enter again or 99 to stop"
Endwhile

totalComboPrice = totalComboPrice + (comboPrice * comboQty);


return totalComboPrice;
endfunction

20
function comboSelect(totalComboPrice)
double comboPrice = 0;
int comboQty = 0
string comboCode = " "
while (comboPrice == -1 || comboCode != "N" || comboCode !=
"n")
prompt"\nEnter the letter of combo or (N) to stop : "
read comboCode
if comboCode == 'A' Then
comboPrice = 5.50
prompt "\nEnter quantity : "
read comboQty
else if comboCode == 'B' Then
comboPrice = 7.50
prompt "\nEnter quantity : "
read comboQty
else if comboCode == 'C' Then
comboPrice = 15.00
prompt "\nEnter quantity : "
read comboQty
else if comboCode == 'D' Then
comboPrice = 12.00
prompt "\nEnter quantity : "
read comboQty
else if comboCode == 'E' Then
comboPrice = 10.00
prompt "\nEnter quantity : "
read comboQty
else if comboCode == 'F' Then
comboPrice = 7.50
prompt "\nEnter quantity : "
read comboQty
else if comboCode == 'G' Then

21
comboPrice = 11.00
prompt "\nEnter quantity : "
read comboQty
else if comboCode == 'H' Then
comboPrice = 11.50
prompt "\nEnter quantity : "
read comboQty
else
if (comboCode == "N" || comboCode == "n")
break
else
Display "Invalid code!"
Endif
Endif
totalComboPrice = totalComboPrice + (comboPrice * comboQty)
return totalComboPrice
endfunction

//function to calculate ticket price


function calcTicketPrice(double qltyPrice,int adultNum,int
childNum,int seniorNum)
double ticketPrice = 0
ticketPrice = (adultNum*(21 + qltyPrice)) + (childNum * (17
+ qltyPrice)) + (seniorNum * (11 + qltyPrice))
return ticketPrice
endfunction

//function to calculate food price


function calcFoodPrice(totalSnackPrice,
totalComboPrice,totalAddonPrice)
double totalFoodPrice = totalSnackPrice + totalComboPrice +
totalAddonPrice
return totalFoodPrice
endfunction
//function to calculate total amount

22
function calcTotalAmount(ticketPrice,foodPrice,const tax)
double totalAmount
//Calculate tax
totalAmount = (ticketPrice + foodPrice) + ((ticketPrice +
foodPrice) * tax)
return totalAmount
endfunction

//function to display
function mainMenu()
Display "***************************************"
Display "Welcome Cinema Ticket Login System"
Display "***************************************"
endfunction

function foodMenu()
Display "\n PRICE LIST FOR
FOOD AND BEVERAGE
\n"
Display
"*==========================================================
==========================================================*\
n"
Display "FOOD & DRINKS\t\t\t\t\tPRICE\n"
Display
"*==========================================================
==========================================================*\
n"
Display "1) POPCORN ORIGINAL (S) or (M)\t\t\tRM3.50/RM4.50\
n"
Display "2) POPCORN CARAMEL (S) or (M)\t\t\tRM4.50/RM5.50\n"
Display "3) POPCORN RED VELVET (S) or (M)\t\tRM7.50/RM8.50\
n"
Display "4) POPCORN CHOCOLATE (S) or (M)\t\t\tRM7.50/RM8.50\
n"
Display "5) CHICKEN NUGGET (S) or (M)\t\t\tRM7.50/RM12.50\n"
Display "6) SAUSAGES (S) or (M)\t\t\t\tRM7.00/RM8.00\n"
Display "7) HOT DOG (S) or (M)\t\t\t\tRM5.50/RM6.50\n"
Display "8) FRIES (S) or (M)\t\t\t\tRM5.50/RM 6.50\n"

23
Display "9) SOFT DRINK (S) or (M)\t\t\tRM3.10/RM3.50\n"
Display "10) MINERAL WATER\t\t\t\tRM2.50\n"
Display "11) HOT/ICED TEA\t\t\t\tRM3.50/RM4.00\n"
Display "12) HOT/ICED LATTE\t\t\t\tRM3.50/RM4.00\n"
Display "13) HOT/ICED CHOCOLATE\t\t\t\tRM4.00/RM 4.50\n"
Display "14) HOT/COLD WHITE COFFEE\t\t\tRM4.00/RM 4.50\n"
Display "15) HOT/ICED MILO\t\t\t\tRM4.00/RM4.50\n"
Display
"*============================================================
========================================================*\n\n"

Display
"*==========================================================
==========================================================*\
n"
Display "COMBO SNACK\t\t\t\t\t\t\t\t\t\tPRICE\n"
Display
"*==========================================================
==========================================================*\
n"
Display "A] 1x POPCORN (M), 1x SOFT DRINK or MINERAL WATER\
t\t\t\t\tRM5.50\n"
Display "B] 1x POPCORN (L), 1x SOFT DRINK or MINERAL WATER\
t\t\t\t\tRM7.50\n"
Display "C] 1x POPCORN (S), 2x SOFT DRINK or MINERAL WATER,
1x CHICKEN NUGGET (6PCS)\t\tRM15.00\n"
Display "D] 1x POPCORN (S), 2x SOFT DRINK or MINERAL WATER,
1x HOTDOG\t\t\t\tRM12.00\n"
Display "E] 1x CHICKEN NUGGET (6PCS), 1x SOFT DRINK or
MINERAL WATER\t\t\t\tRM10.00\n"
Display "F] 1x HOT DOG, 1x SOFT DRINK or MINERAL WATER\t\t\
t\t\t\tRM7.50\n"
Display "G] 1x RED VELVET or CHOCOLATE POPCORN, 1x SOFT
DRINK or MINERAL WATER\t\t\tRM11.00\n"
Display "H] 1x SAUSAGES (8PCS), 1x SOFT DRINK or MINERAL
WATER\t\t\t\t\tRM11.50\n\n"
Display
"*==========================================================
==========================================================*\
n\n"

24
Display
"*=====================================================*\n"
Display"ADD-ONS\t\t\t\tPRICE\n"
Display
"*=====================================================*\n"
Display "1) FRIES (S)\t\t\tRM3.00 EACH\n"
Display "2) POPCORN IN A CUP\t" "\n"
Display "3) SAUSAGES (5PCS)\t" "\n"
Display
"-------------------------------------------------------\n"
Display "4) HOTDOG\t\t\tRM5.00 EACH\n"
Display "5) CHICKEN NUGGET (5PCS)\t" "\n"
Display "6) MEATBALLS (5PCS)\t" "\n"
Display
"*=====================================================*\n"
endfunction

function isValidDate(const string& date)


if (date.length() != 5 || date[2] != '/')
return false
if (!isdigit(date[0]) || !isdigit(date[1]) || !
isdigit(date[3]) || !isdigit(date[4]))
return false
int day = (date[0] - '0') * 10 + (date[1] - '0')
int month = (date[3] - '0') * 10 + (date[4] - '0')
if (day < 1 || day > 31 || month < 1 || month > 12)
return false
return true
endfunction

//Main function

//Registration & Login variable


string newUsername,newPass, username, pass;
//Array Declaration
string user[100], password[100];

25
int answer;
bool check = false;
int programSelection = 0,selection = 0;

//Movie variable
string movie1 = "Interstellar", movie2 = "Oppenheimer", movie3
= "Sijjin", movie4 = "La La Land",
movieChoice,movieQlty,date,showTime;
int movieID, adultNum, childNum, seniorNum,qltyPrice;
int hall = 5,i = 0, o = 0;

//Food and Beverage variable


int snackCode = 0,comboQty = 0,addon = 0;
double snackPrice = 0, totalSnackPrice = 0, comboPrice = -1,
totalComboPrice = 0, addonPrice = 0, totalAddonPrice = 0;
string snackSize = "",comboCode = "";

//Admin variable
int adminOpt = 0,promocode = 0, movieChange, adminPass = 2005,
enteredCode = 0,customerCount = 0,totalTicket = 0;
double highest = 0, lowest = 100000, average = 0,totalSales = 0;

//Payment and Discount variable


const double tax = 0.06;
char student, oku,paymentMethod, discountTypeChoice;
int discountCode;
string name,ic, discountEvent,discountType;
double eWalletPin = 0, cardPin = 0, cardCvv = 0, cardExpiration
= 0;
bool confirmation = false;

mainMenu()
Do
//registration login section
Do
prompt "Select one: 1.Register 2.Login 3.Admin"

26
read answer
if answer == 1 Then
do
registration(newUsername,newPassword)
username[i] = newUsername
password[i] = newPass
i++
display "Registration sucessful!'
answer = 2
while(answer == 1)
Endwhile
else if answer = 2 Then
while(check != true)
login(username,password)
for(o;o<100,o++)
if ((username == user[o]) && (pass ==
password[o])) Then
check = true
Endif
if(check != true)
"Incorrect username or password"
Endif
Endwhile
else if answer == 3
adminOpt = 0
while (adminOpt != 99)
prompt "Please enter the Admin Code : "
do
read enteredCode
if (enteredCode == adminPass)
Display
"****************************************
"
Display "\n\tWelcome to the Admin System"

27
Display "\
n****************************************
"
Display "\nCustomer count \t\t:" +
customerCount
Display"\nTotal Tickets Sold \t:" +
totalTicket
Display "\nTotal Sales today \t:RM" +
totalSales
Display "\nThe Average spending \t:RM" +
average
Display "\nThe Highest spending \t:RM" +
highest
Display "\nThe Lowest spending \t:RM" +
lowest
while (adminOpt != 99)
Display "\n\nWhat do you want to
do? \n1.Change promocode \n2.Change movie
available \n3.Change admin code \n99.Log
Out\n"
prompt adminOpt
if (adminOpt == 1)

prompt "Enter the new promocode \


t:"
read promocode

Display "Successfully change,


the new code is now : " +
promocode
else if (adminOpt == 2) {

prompt "Which movie do you


want to change? : ." + movie1 +
movie2 + movie3 + movie4
read movieChange
if (movieChange == 1) {

prompt "\nEnter the new


movie :"
read movie1

28
Display "\nThe new
movie is : " << movie1
else if (movieChange == 2) {

prompt "\nEnter the new


movie :"
read movie2

Display "\nThe new


movie is : " << movie2
else if (movieChange == 3) {

prompt "\nEnter the


new movie :"
read movie3

Display "\nThe new movie


is : " << movie3
else if (movieChange == 4) {

prompt "\nEnter the


new movie :"
read movie4

Display "\nThe new movie


is : " << movie4
Endif
Endif
Endwhile
else { cout << "Incorrect
Password !\n Enter Again : "; }
Endif
while (enteredCode != adminPass);
Endwhile
Endwhile
Endif
while (check != true);
Endwhile
do

29
if(check=true)
// Movie Menu selection section
//Main Menu
Display "You are logged in!\n\n\n\n";

Display "\n************************* WELCOME TO ONLINE


CINEMA TICKETING SYSTEM
******************************************\n\n"
Display " NOW SHOWING
MOVIES AND PRICE
"
Display
"*=============================================================
===============================================*\n"
Display " Movie Id\tMovie Title\tClassification\tScreen
quality\tPrice Adult\tPrice Children\tPrice Senior/OKU \n"
Display
"==============================================================
===============================================\n"

// Movie 1
Display "1\t\t" << movie1 << "\t\tPG13\tNormal\t\tRM 21\
t\tRM 17\t\tRM 11\n"
Display "\t\t\t\t\t\tImax\t\t\t\t+ RM 4\n"
Display "\t\t\t\t\t\t3D\t\t\t\t+ RM 5\n\n"

// Movie 2
Display "2\t\t" << movie2 << "\t\tR18\tNormal\t\tRM 21\
t\t\t\tRM 11\n"
Display "\t\t\t\t\t\tImax\t\t\t\t+ RM 4\n"
Display "\t\t\t\t\t\t3D\t\t\t\t+ RM 5\n\n"

// Movie 3
Display "3\t\t" << movie3 << "\t\t\tR16\tNormal\t\tRM
21\t\t\t\tRM 11\n"
Display "\t\t\t\t\t\tImax\t\t\t\t+ RM 4\n"
Display "\t\t\t\t\t\t3D\t\t\t\t+ RM 5\n\n"

// Movie 4

30
Display "4\t\t" << movie4 << "\t\tPG13\tNormal\t\
tRM 21\t\tRM 17\t\tRM 11\n"
Display "\t\t\t\t\t\tImax\t\t\t\t+ RM 4\n"
Display "\t\t\t\t\t\t3D\t\t\t\t+ RM 5\n"

Display
"*=============================================================
================================================*\n\n"

//movieSelection
do
prompt "\nPlease type in the movie ID\t :"
read movieID
if movieID == 1 Do
movieChoice = movie1
else if movieID == 2 Do
movieChoice = movie2
else if movieID == 3 Do
movieChoice = movie3
else if movieID == 4 Do
movieChoice = movie4
else
display "Invalid movie choice",movieChoice =
"Invalid"
Endif
while(movieChoice == "Invalid")
Endwhile

hall = randomNumber between 1 to 5


do
prompt "Please select a the movie quality
Normal/3D/IMAX : "
do
read movieQlty
if movieQlty == "Normal" Then
qualityPrice = 0

31
else if movieQlty == "3D" Then
qualityPrice = 4
else if movieQlty == "IMAX" Then
qualityPrice = 5
else
"Incorrect movie quality types"
movieQlty = "Invalid"
Endif
while(movieQlty == "Invalid")
Endwhile

do
prompt "Enter the quantity of number of
adult,children and senior : "
read qtyAdult,qtyChild,qtySenior
if (adultNum >= 0) || (childNum >= 0) || (seniorNum
>= 0)) || ((adultNum + childNum + seniorNum <= 0))
display "\nTotal Ticket : " + adultNum +
childNum + seniorNum
display "\nAdult Ticket : " + adultNum + "\
nChild Ticket : " + childNum +"\nSenior Ticket
: " + seniorNum
else
adultNum = -1
display "Invalid Number of Person !"
Endif
while(adultNum == -1)
Endwhile

//Food and Beverages selection section


foodMenu() //calling function
totalSnackPrice = snackSelect(totalSnackPrice) //
calling function
totalComboPrice = comboSelect(totalComboPrice)

32
prompt "Do you want to addon? 99 - NO "
while snackAddon != 99
read addon
if snackAddon == 1||2||3 Then
addonPrice = 3.00
else if snackAddon == 4||5||6 Then
addonPrice = 5.00
else if (addon != 99)
display "invalid code"
addon = -1
read addon
Endif
Endwhile

//Movie Date and Time Selection


do
prompt "\nEnter the date. example (21/01) : "
read date

if (!isValidDate(date))
cout << "\nInvalid date format or values!
Please enter a valid date.\n"

while (!isValidDate(date))

// Show Time Selection


string showTime;
display "\nEnter the show time (10:00, 14:00, 16:00,
18:00, 21:00): "
do
read showTime
if (showTime != "10:00"
&& showTime != "14:00" && showTime !=
"16:00" && showTime != "18:00" &&
showTime != "21:00")

33
cout << "Invalid show time! \n Please try
again : "
showTime = "303"
Endif
while (showTime == "303")

double discount = 0

// Discount based on selected date


if (date >= "10/02" && date <= "17/02") { // Chinese
New Year
double discount = 0.1
discountEvent = "Chinese New Year"

else if (date >= "09/04" && date <= "11/04") // Eid


Al-Fitr
double discount = 0.1
discountEvent = "Eid Al-Fitr"

else if (date >= "01/11" && date <= "07/11") //


Deepavali
double discount = 0.1
discountEvent = "Deepavali"

else if (date >= "30/08" && date <= "31/08") //


National Day
double discount = 0.1
discountEvent = "National Day"

else if (date >= "15/09" && date <= "16/09") //


Malaysia Day
double discount = 0.1
discountEvent = "Malaysia Day"

else if (date >= "24/12" && date <= "25/12") {//


Christmas Day
double discount = 0.1

34
discountEvent = "Christmas Day"
else
discountEvent = "No Event Discount"
cout << "The date you given does not have special
discount."
Endif

//Discount Section
prompt "Enter a promo code if you have it : "
read promoCode
prompt "Are you a Student? Y - Yes / N - No"
read student
prompt "Are you a holder of OKU card? Y - Yes / N -
No"
read oku
if student == 'Y' then
specialDisc = 5
discountType = "Student"
else if oku == 'Y'
specialDisc = 0
discountType = "OKU"
else
specialDisc = 0
discountType = "NONE"
Endif
if promoCode == discountCode rhen
discount += 0.1
else
discount += 0
Endif

Display"\nSpecial Discount:RM " << specialDisc << "


OFF "
Display "\nPromo Code Discount: " << discount * 100
<< "%"

35
//Calculate ticket,food price
ticketPrice = (qtyAdult*(21+qualityPrice))+
(qtyChild*(17+qualityPrice))+
(qtySenior*(11+qualityPrice))
foodPrice = snackPrice + comboPrice + addon
//Calling Function to calculate totalAmount
totalAmount =
calcTotal(ticketPrice,foodPrice,specialDisc,discount
)
display "Your total price is :RM "
display totalAmount
//Payment selection
prompt "Select your payment method A - eWallet || B
- Debit/Credit Card"
While confirmation = false Do
read paymentMethod
if paymentMethod == A Then
prompt "Enter your name : "
read name
prompt "Enter your IC : "
read IC
prompt "Enter your wallet EWallet pin : "
read eWalletPin
confirmation = true
else if paymentMethod == B Then
prompt "Enter your name : "
read name
prompt "Enter your IC : "
read IC
prompt "Enter your card pin : "
read cardPin
prompt "Enter your card CVV : "
read cardCVV
prompt "Enter your card expiration date : "
read cardExpiration

36
confirmation = true
else
display “Incorrect Input “
Endif
Endwhile

//display ticket
display "\
n*************************************************\
n"
display "\nSelected Movie\t\t: " + movieChoice
display "\nMovie Quality\t\t: " + movieQlty
display "\nSelected Date\t\t: " + date
display "\nSelected Show Time\t: " + showTime
display "\nHall Number \t\t: " + hall
display "\nDiscount Type\t\t: " + discountType
display "\nEvent Special Discount\t: " +
discountEvent
display "\
n*************************************************\
n"

//Calling function to calculate total price


ticketPrice = calcTicketPrice(qltyPrice, adultNum,
childNum, seniorNum)
foodPrice = calcFoodPrice(totalSnackPrice,
totalComboPrice, totalAddonPrice)
totalAmount = calcTotalAmount(ticketPrice,
foodPrice, tax)
totalDiscount = (totalAmount * discount) +
specialDisc
totalPrice = totalAmount - totalDiscount

// Display the total price and total discount at the


end
Display "\
n*************************************************"

37
Display "\nTotal Ticket Price \t\t: RM" +
ticketPrice
Display "\nTotal Food & Beverage Price\t: RM" +
foodPrice
Display "\nTotal Price after tax(6% GST)\t: RM" +
totalAmount
Display "\nTotal Discount \t\t\t: RM"+ totalDiscount
Display "\nTotal Price After Discount \t: RM" +
totalPrice
Display "\
n*************************************************\
n"

// Selection to repeat or log off


do
prompt "Do you want to :\n1.Log Off \n2.Book Again\
n"
read selection
while (selection != 1 && selection != 2)
Endwhile
Endif
while(selection != 1)
Endwhile

// Admin Information calculation


if (totalPrice > highest)
highest = totalPrice
Endif
if (totalPrice < lowest)
lowest = totalPrice
Endif
totalSales = totalSales + totalPrice
customerCount += 1
average = totalSales / customerCount
totalTicket = totalTicket + (adultNum + childNum + seniorNum)

// Selection to stop or continue the program

38
do
cout << "\nDo you want to stop the program?\n1.Yes \n2.No\
n";
cin >> programSelection;
cout << "\n";
while (programSelection != 1 && programSelection != 2);
Endwhile
while(programSelection != 1)
end

39
4.0 Source Code
#include <iostream>
#include <iomanip>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;

//function declaration
void registration(string& newUsername, string& newPassword);
void login(string& username, string& password);
double snackSelect(double totalSnackPrice);
double comboSelect(double totalComboPrice);
double calcTicketPrice(double qltyPrice, int adultNum, int childNum,
int seniorNum);
double calcFoodPrice(double totalSnackPrice, double
totalComboPrice,double totalAddonPrice);
double calcTotalAmount(double ticketPrice, double foodPrice, const
double tax);
double promoCode(double discountCode, int promocode);
void foodMenu();
bool isValidDate(const string& date);

int main(){
//Registration & Login variable
string newUsername,newPass, username, pass;
//Array Declaration
string user[100], password[100];

40
int answer;
bool check = false;
int programSelection = 0,selection = 0;

//Movie variable
string movie1 = "Interstellar", movie2 = "Oppenheimer", movie3
= "Sijjin", movie4 = "La La Land",
movieChoice,movieQlty,date,showTime;
int movieID, adultNum, childNum, seniorNum,qltyPrice;
int hall = 5,i = 0, o = 0;

//Food and Beverage variable


int addon = 0;
double totalSnackPrice = 0, totalComboPrice = 0, addonPrice =
0, totalAddonPrice = 0;

//Admin variable
int adminOpt = 0,promocode = 0, movieChange, adminPass = 2005,
enteredCode = 0,customerCount = 0,totalTicket = 0;
double highest = 0, lowest = 100000, average = 0,totalSales =
0;

//Payment and Discount variable


const double tax = 0.06;
char student, oku,paymentMethod, discountTypeChoice;
int discountCode;
string name,ic, discountEvent,discountType, cardExpiration =
0;
double eWalletPin = 0, cardPin = 0, cardCvv = 0;
bool confirmation = false;

//Price variable
double totalAmount = 0, totalPrice = 0, ticketPrice = 0,
foodPrice = 0, specialDisc = 0, totalDiscount = 0, discount =
0;

41
cout <<
"*************************************************************
*****";
cout << "\n\t\tWelcome to Cinema Ticket Login System";
cout << "\
n*************************************************************
*****\n";

do {
//Registration & Login
newUsername = "", newPass = "", username = "", pass = "";
check = false;
do {
cout << "Select one : \n1.Register\n2.Login\
n3.Admin\n ";
cin >> answer;

if (answer == 1) {
do {
registration(newUsername, newPass);
user[i] = newUsername;
password[i] = newPass;
i++;
cout << "Registration sucessful!\n\n";
answer = 2;
} while (answer == 1);

}
else if (answer == 2) {
while (check != true) {
login(username, pass);
o = 0;

42
for (o; o < 100; o++)
if ((username == user[o]) && (pass
== password[o]))
{
check = true;
}
if (check != true) { cout << "\nincorrect
username or password"; }
}
}
else if (answer == 3) {
adminOpt = 0;
while (adminOpt != 99) {
cout << "Please enter the Admin Code : ";
do {
cin >> enteredCode;
if (enteredCode == adminPass) {

cout <<
"*****************************
***********";

cout << "\n\tWelcome to the


Admin System";

cout << "\


n*****************************
***********";

cout << "\nCustomer count \t\


t:" << customerCount;

cout << "\nTotal Tickets Sold


\t:" << totalTicket;

cout << "\nTotal Sales today \


t:RM" << totalSales;

43
cout << "\nThe Average
spending \t:RM" << average ;

cout << "\nThe Highest


spending \t:RM" << highest;

cout << "\nThe Lowest spending


\t:RM" << lowest;
while (adminOpt != 99) {

cout << "\n\nWhat do you want


to do? \n1.Change promocode \
n2.Change movie available \
n3.Change admin code \n99.Log
Out\n";
cin >> adminOpt;
if (adminOpt == 1) {
cout << "Enter the
new promocode \t:";
cin >> promocode;
cout << "\
nSuccessfully
change, the new
code is now : " <<
promocode;
}
else if (adminOpt == 2)
{
cout << "\nWhich
movie do you want
to change? : \n1."
<< movie1 << "\n2."
<< movie2 << "\n3."
<< movie3 << "\n4."
<< movie4 << endl;
cin >> movieChange;
if (movieChange ==
1) {
cout << "\
nEnter the new
movie :";

44
cin >> movie1;
cout << "\nThe
new movie is :
" << movie1;
}

else if
(movieChange == 2)
{
cout << "\
nEnter the new
movie :";
cin >> movie2;
cout << "\nThe
new movie is :
" << movie2;
}
else if
(movieChange == 3)
{
cout << "\
nEnter the new
movie :";
cin >> movie3;
cout << "\nThe
new movie is :
" << movie3;
}
else if
(movieChange == 4)
{
cout << "\
nEnter the new
movie :";
cin >> movie4;
cout << "\nThe
new movie is :
" << movie4;
}

45
else if (adminOpt
== 3) {

cout << "\


nEnter the new
admin code :
";

cin >>
adminPass;
}
else { cout << "\
nWrong Input,enter
again !.\n"; }
}
}
}
else { cout << "Incorrect
Password !\n Enter Again : "; }

} while (enteredCode != adminPass);


}
}
} while (check != true);

do {
if (check = true) {
//Main Menu
cout << "You are logged in!\n\n\n\n";

cout << "\n************************* WELCOME


TO ONLINE CINEMA TICKETING SYSTEM
******************************************\n\
n";
cout << " NOW
SHOWING MOVIES AND PRICE
";
cout << endl;

46
cout <<
"*===========================================
=============================================
====================*\n";
cout << " Movie Id\tMovie Title\
tClassification\tScreen quality\tPrice Adult\
tPrice Children\tPrice Senior/OKU \n";
cout <<
"=============================================
==============================================
==================\n";

// Movie 1
cout << "1\t\t" << movie1 <<
"\t\tPG13\tNormal\t\tRM 21\t\tRM 17\t\tRM 11\
n";
cout << "\t\t\t\t\t\tImax\t\t\t\t+ RM 4\n";
cout << "\t\t\t\t\t\t3D\t\t\t\t+ RM 5\n\n";

// Movie 2
cout << "2\t\t" << movie2 << "\t\tR18\tNormal\
t\tRM 21\t\t\t\tRM 11\n";
cout << "\t\t\t\t\t\tImax\t\t\t\t+ RM 4\n";
cout << "\t\t\t\t\t\t3D\t\t\t\t+ RM 5\n\n";

// Movie 3
cout << "3\t\t" << movie3 << "\t\t\tR16\
tNormal\t\tRM 21\t\t\t\tRM 11\n";
cout << "\t\t\t\t\t\tImax\t\t\t\t+ RM 4\n";
cout << "\t\t\t\t\t\t3D\t\t\t\t+ RM 5\n\n";

// Movie 4
cout << "4\t\t" << movie4 << "\t\tPG13\
tNormal\t\tRM 21\t\tRM 17\t\tRM 11\n";
cout << "\t\t\t\t\t\tImax\t\t\t\t+ RM 4\n";
cout << "\t\t\t\t\t\t3D\t\t\t\t+ RM 5\n";

47
cout <<
"*============================================
==============================================
===================*\n\n";
cout << endl;

//Movie Selection
do {
cout << "\nPlease type in the movie ID\
t : ";
cin >> movieID;
if (movieID == 1) {
movieChoice = movie1;
cout << "Your Choice is :" << movie1;
}
else if (movieID == 2) {
movieChoice = movie2;
cout << "Your Choice is :" <<
movie2;
}
else if (movieID == 3) {
movieChoice = movie3;
cout << "Your Choice is :" <<
movie3;
}
else if (movieID == 4) {
movieChoice = movie4;
cout << "Your Choice is :" <<
movie4;
}
else { movieID = 0 ; cout << "Invalid
Choice"; }
} while (movieID == 0);

// Assign the hall number

48
srand(static_cast<unsigned
int>(std::time(0)));
hall = rand() % 5 + 1;

//Quality Selection
do {
cout << "\nPlease type in the movie
quality : ";
cin >> movieQlty;
if ((movieQlty == "Normal") || (movieQlty
== "normal")) {
qltyPrice = 0;
}
else if ((movieQlty == "3D") ||
(movieQlty == "3d")) {
qltyPrice = 4;
}
else if ((movieQlty == "IMAX") ||
(movieQlty == "imax") || (movieQlty ==
"Imax")) {
qltyPrice = 5;
}
else { movieQlty = "invalid"; cout <<
"Invalid Choice"; }
} while (movieQlty == "invalid");

do {
cout << "\nEnter the number of \nAdult :
";
cin >> adultNum;
cout << "\nChild : ";
cin >> childNum;
cout << "\nSenior : ";
cin >> seniorNum;

49
if (((adultNum >= 0) && (childNum >= 0)
&& (seniorNum >= 0)) && ((adultNum +
childNum + seniorNum >= 0))) {
cout << "\nTotal Ticket : " << adultNum +
childNum + seniorNum;
cout << "\nAdult Ticket : " << adultNum
<< "\nChild Ticket : " << childNum << "\
nSenior Ticket : " << seniorNum;
}
else { adultNum = -1; cout << "Invalid
Number of Person !"; }
} while (adultNum == -1);

//Food and Beverage Menu


foodMenu();

//Food and Drinks Selection


totalSnackPrice =
snackSelect(totalSnackPrice);

//Combo Selection
totalComboPrice =
comboSelect(totalComboPrice);

//Addon Selection
cout << "\nDo you want to addon? Enter the
code or 99 for NO : ";
while (addon != 99) {
cin >> addon;
if (addon == 1 || addon == 2 || addon ==
3) {
addonPrice = 3.00;
}
else if (addon == 4 || addon == 5 ||
addon == 6) {
addonPrice = 5.00;
}

50
else{
cout << "Invalid addon code\n";
}
cout << "\nEnter Again or 99 to skip : ";
cin.clear();
cin.ignore(numeric_limits<streamsize>::ma
x(), '\n');
cin >> addon;
totalAddonPrice += addonPrice;
}
//Movie Date and Time Selection
do {
cout << "\nEnter the date. example(21/01)
: ";
cin >> date;

if (!isValidDate(date)) {
cout << "\nInvalid date format or
values! Please enter a valid date.\n";
}
} while (!isValidDate(date));

// Show Time Selection


string showTime;
cout << "\nEnter the show time (10:00, 14:00,
16:00, 18:00, 21:00): ";
do {
cin >> showTime;
if (showTime != "10:00" && showTime != "14:00"
&& showTime != "16:00" && showTime != "18:00"
&& showTime != "21:00") {
cout << "Invalid show time! \n Please try
again : ";
showTime = "303";
}

51
} while (showTime == "303");

double discount = 0;

// Discount based on selected date


if (date >= "10/02" && date <= "17/02") { //
Chinese New Year
double discount = 0.1;
discountEvent = "Chinese New Year";
}
else if (date >= "09/04" && date <= "11/04") {
// Eid Al-Fitr
double discount = 0.1;
discountEvent = "Eid Al-Fitr";
}
else if (date >= "01/11" &&
date <= "07/11") { // Deepavali
double discount = 0.1;
discountEvent = "Deepavali";
}
else if (date >= "30/08" && date <= "31/08") {
// National Day
double discount = 0.1;
discountEvent = "National Day";
}
else if (date >= "15/09" && date <= "16/09")
{ // Malaysia Day
double discount = 0.1;
discountEvent = "Malaysia Day";
}
else if (date >= "24/12" && date <= "25/12") {
// Christmas Day
double discount = 0.1;
discountEvent = "Christmas Day";
}

52
else {
discountEvent = "No Event Discount";
cout << "The date you given does not have
special discount.";
}

//Promocode selection
cout << "\nEnter a promo code if you have it :
";
cin >> discountCode;

cout << "\nAre you a student? [Y - yes | N -


no]: ";
cin >> student;

cout << "\nDo you have OKU card? [Y - yes | N


- no]: ";
cin >> oku;

if (student == 'Y' || student == 'y' ) {


specialDisc = 5;
discountType = "Student";
}
else if (oku == 'y' || oku == 'Y'){
specialDisc = 10;
discountType = "OKU";
}
else { specialDisc = 0; discountType = "NONE";
}
discount = promoCode(discountCode, promocode);

cout << "\nSpecial Discount:RM " <<


specialDisc << " OFF ";
cout << "\nPromo Code Discount: " << discount
* 100 << "%";

53
//Payment section
cout << "\nSelect your payment method [A-
eWallet || B- Debit/Credit Card]:";
while (confirmation == false ){
cin >> paymentMethod;
if (paymentMethod == 'A' || paymentMethod
== 'a')
{
cout << "\nEnter your name: ";
cin >> ws;
getline(cin, name);
cout << "\nEnter your IC: ";
cin >> ws;
getline(cin, ic);
cout << "\nEnter your eWallet pin:
";
cin >> eWalletPin;
confirmation = true;
}
else if (paymentMethod == 'B' ||
paymentMethod == 'b')
{
cout << "\nEnter your name\t: ";
cin >> ws;
getline(cin, name);
cout << "\nEnter your IC\t: ";
cin >> ws;
getline(cin, ic);
cout << "\nEnter your card pin\t:
";
cin >> cardPin;
cout << "\nEnter your card 3/4
Digit CVV\t: ";

54
cin >> cardCvv;
cout << "\nEnter your card
expiration date (DD/MM)\t: ";
cin >> cardExpiration;
confirmation = true;
}
else
{
cout << "\nIncorrect Input. Try
again.\n";
}

}
// Display the
selected movie, date, show time,
discounted prices, discount type,
and discount event
cout << "\
n*********************************************
****\n";
cout << "\nSelected Movie\t\t: " <<
movieChoice;
cout << "\nMovie Quality\t\t: " << movieQlty;
cout << "\nSelected Date\t\t: " << date;
cout << "\nSelected Show Time\t: " <<
showTime;
cout << "\nHall Number \t\t: " << hall;
cout << "\nDiscount Type\t\t: " <<
discountType;
cout << "\nEvent Special Discount\t: " <<
discountEvent;
cout << "\
n*********************************************
****\n";

//Calling function to calculate total price


ticketPrice = calcTicketPrice(qltyPrice,
adultNum, childNum, seniorNum);

55
foodPrice = calcFoodPrice(totalSnackPrice,
totalComboPrice, totalAddonPrice);
totalAmount = calcTotalAmount(ticketPrice,
foodPrice, tax);
totalDiscount = (totalAmount * discount) +
specialDisc;
totalPrice = totalAmount - totalDiscount;

// Display the total price and


total discount at the end
cout << "\
n*********************************************
****";
cout << "\nTotal Ticket Price \t\t: RM" <<
ticketPrice;
cout << "\nTotal Food &
Beverage Price\t: RM" << foodPrice;
cout << "\nTotal Price after tax(6% GST)\t:
RM" << totalAmount;
cout << "\nTotal Discount \t\t\t: RM" <<
totalDiscount;
cout << "\nTotal Price After Discount \t: RM"
<< totalPrice;
cout << "\
n*********************************************
****\n";

// Selection to repeat or log off


do {
cout << "Do you want to :\n1.Log Off \
n2.Book Again\n";
cin >> selection;
} while (selection != 1 && selection != 2);
}
}while (selection != 1);

// Admin Information calculation

56
if (totalPrice > highest) {
highest = totalPrice;
}
if (totalPrice < lowest) {
lowest = totalPrice;
}
totalSales = totalSales + totalPrice;
customerCount += 1;
average = totalSales / customerCount;
totalTicket = totalTicket + (adultNum + childNum +
seniorNum);

// Selection to stop or continue the program


do {
cout << "\nDo you want to stop the program?\n1.Yes \
n2.No\n";
cin >> programSelection;
cout << "\n";
} while (programSelection != 1 && programSelection != 2);

}while (programSelection != 1);

}
//Function
void registration(string& newUsername, string& newPassword) {
cout << "Enter your new name :";
cin >> ws;
getline(cin, username);
cout << "Enter your new password : ";
cin >> ws;
getline(cin, password);

57
}
void login(string& username, string& password) {
cout << "\nEnter your name :";
cin >> ws;
getline(cin, username);
cout << "\nEnter your password : ";
cin >> ws;
getline(cin, password);
}

double snackSelect(double totalSnackPrice) {


int snackCode = 0;
double snackPrice = 0;
string snackSize = " ";
cout << "\nEnter the Food and Snack code you want. 99-NO :";
while (snackCode != 99) {
cin >> snackCode;
if (snackCode == 1) {
cout << "\nWhat size do you want (S)Smallor(M)Medium
:";
do {
cin >> snackSize;
if ((snackSize == "s") || (snackSize == "S"))
{
snackPrice += 3.50;
}
else if ((snackSize == "m") || (snackSize ==
"M")) {
snackPrice += 4.50;
}
else { cout << "Invalid size !"; snackPrice =
-1; }
} while (snackPrice == -1);

58
}
else if (snackCode == 2) {
cout << "\nWhat size do you want (S)Small or
(M)Medium :";
do {
cin >> snackSize;
if ((snackSize == "s") || (snackSize == "S"))
{
snackPrice += 4.50;
}
else if ((snackSize == "m") || (snackSize ==
"M")) {
snackPrice += 5.50;
}
else { cout << "Invalid size !"; snackPrice =
-1; }
} while (snackPrice == -1);
}
else if (snackCode == 3 || snackCode == 4) {
cout << "\nWhat size do you want (S)Small or
(M)Medium :";
do {
cin >> snackSize;
if ((snackSize == "s") || (snackSize == "S"))
{
snackPrice += 7.50;
}
else if ((snackSize == "m") || (snackSize ==
"M")) {
snackPrice += 8.50;
}
else { cout << "Invalid size !"; snackPrice =
-1; }
} while (snackPrice == -1);
}
else if (snackCode == 5) {

59
cout << "\nWhat size do you want (S)Small or
(M)Medium :";
do {
cin >> snackSize;
if ((snackSize == "s") || (snackSize == "S"))
{
snackPrice += 7.50;
}
else if ((snackSize == "m") || (snackSize ==
"M")) {
snackPrice += 12.50;
}
else { cout << "Invalid size !"; snackPrice =
-1; }
} while (snackPrice == -1);
}
else if (snackCode == 6) {
cout << "\nWhat size do you want (S)Small or
(M)Medium :";
do {
cin >> snackSize;
if ((snackSize == "s") || (snackSize == "S"))
{
snackPrice += 7.0;
}
else if ((snackSize == "m") || (snackSize ==
"M")) {
snackPrice += 8.00;
}
else { cout << "Invalid size !"; snackPrice =
-1; }
} while (snackPrice == -1);
}
else if (snackCode == 7 || snackCode == 8) {
cout << "\nWhat size do you want (S)Small or
(M)Medium :";

60
do {
cin >> snackSize;
if ((snackSize == "s") || (snackSize == "S"))
{
snackPrice += 4.50;
}
else if ((snackSize == "m") || (snackSize
=="M")) {
snackPrice += 6.50;
}
else { cout << "Invalid size !"; snackPrice =
-1; }
} while (snackPrice == -1);
}
else if (snackCode == 9) {
cout << "\nWhat size do you want (S)Small or
(M)Medium :";
do {
cin >> snackSize;
if ((snackSize == "s") || (snackSize == "S"))
{
snackPrice += 3.10;
}
else if ((snackSize == "m") || (snackSize ==
"M")) {
snackPrice += 3.50;
}
else { cout << "Invalid size !"; snackPrice =
-1; }
} while (snackPrice == -1);
}
else if (snackCode == 10) {
snackPrice += 2.50;
}
else if (snackCode == 11 || snackCode == 12) {

61
cout << "\nDo you want (C)Cold or (H)Hot : ";
do {
cin >> snackSize;
if ((snackSize == "c") || (snackSize == "C"))
{
snackPrice += 3.50;
}
else if ((snackSize == "h") || (snackSize ==
"H")) {
snackPrice += 4.00;
}
else { cout << "Invalid choice !"; snackPrice
= -1; }
} while (snackPrice == -1);
}
else if (snackCode == 13 || snackCode == 14 || snackCode
== 15) {
cout << "\nDo you want (C)Cold or (H)Hot : ";
do {
cin >> snackSize;
if ((snackSize == "c") || (snackSize == "C"))
{
snackPrice += 4.00;
}
else if ((snackSize == "h") || (snackSize ==
"H")) {
snackPrice += 4.50;
}
else { cout << "Invalid choice !"; snackPrice
= -1; }
} while (snackPrice == -1);
}
else{
cout << "\nInvalid Food Code !\n ";
}

62
cout << "Enter again or 99 to stop : ";
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cin >> snackCode;
cout << "Enter again or 99 to stop : ";
}
totalSnackPrice = totalSnackPrice + snackPrice;
return totalSnackPrice;
}
double comboSelect(double totalComboPrice) {
double comboPrice = 0;
int comboQty = 0;
string comboCode = " ";
do {
cout << "\nEnter the letter of combo or (N) to stop : ";
cin >> comboCode;
if (comboCode == "A") {
comboPrice = 5.50;
cout << "\nEnter quantity : ";
cin >> comboQty;
}
else if (comboCode == "B" || comboCode == "F") {
comboPrice = 7.50;
cout << "\nEnter quantity : ";
cin >> comboQty;
}
else if (comboCode == "C") {
comboPrice = 15.00;
cout << "\nEnter quantity : ";
cin >> comboQty;
}
else if (comboCode == "D") {
comboPrice = 12.00;

63
cout << "\nEnter quantity : ";
cin >> comboQty;
}
else if (comboCode == "E") {
comboPrice = 10.00;
cout << "\nEnter quantity : ";
cin >> comboQty;
}
else if (comboCode == "G") {
comboPrice = 11.00;
}
else if (comboCode == "H") {
comboPrice = 11.50;
cout << "\nEnter quantity : ";
cin >> comboQty;
}
else{
if (comboCode == "N" || comboCode == "n") {
break;
}
else { cout << "Invalid code!"; }
}
} while (comboPrice == -1 || comboCode != "N" || comboCode !=
"n");
totalComboPrice = totalComboPrice + (comboPrice * comboQty);
return totalComboPrice;
}
double calcTicketPrice(double qltyPrice,int adultNum,int
childNum,int seniorNum){
double ticketPrice = 0;
ticketPrice = (adultNum*(21 + qltyPrice)) + (childNum * (17 +
qltyPrice)) + (seniorNum * (11 + qltyPrice));
return ticketPrice;
}

64
double calcFoodPrice(double totalSnackPrice, double
totalComboPrice,double totalAddonPrice) {
double totalFoodPrice = totalSnackPrice + totalComboPrice +
totalAddonPrice;
return totalFoodPrice;
}
double calcTotalAmount(double ticketPrice, double foodPrice,const
double tax) {
double totalAmount;
//Calculate tax
totalAmount = (ticketPrice + foodPrice) + ((ticketPrice +
foodPrice) * tax);
return totalAmount;
}
double promoCode(double discountCode,int promocode) {
if (discountCode == promocode) {
discount += 0.1;
}
else {
discount += 0;
}
return discount;
}
void foodMenu() {
cout << "\n PRICE LIST FOR
FOOD AND BEVERAGE \
n";
cout <<
"*============================================================
========================================================*\n";
cout << "FOOD & DRINKS\t\t\t\t\tPRICE\n";
cout <<
"*=============================================================
=======================================================*\n";
cout << "1) POPCORN ORIGINAL (S) or (M)\t\t\tRM3.50/RM4.50\n";
cout << "2) POPCORN CARAMEL (S) or (M)\t\t\tRM4.50/RM5.50\n";

65
cout << "3) POPCORN RED VELVET (S) or (M)\t\tRM7.50/RM8.50\n";
cout << "4) POPCORN CHOCOLATE (S) or (M)\t\t\tRM7.50/RM8.50\
n";
cout << "5) CHICKEN NUGGET (S) or (M)\t\t\tRM7.50/RM12.50\n";
cout << "6) SAUSAGES (S) or (M)\t\t\t\tRM7.00/RM8.00\n";
cout << "7) HOT DOG (S) or (M)\t\t\t\tRM5.50/RM6.50\n";
cout << "8) FRIES (S) or (M)\t\t\t\tRM5.50/RM 6.50\n";
cout << "9) SOFT DRINK (S) or (M)\t\t\tRM3.10/RM3.50\n";
cout << "10) MINERAL WATER\t\t\t\tRM2.50\n";
cout << "11) HOT/ICED TEA\t\t\t\tRM3.50/RM4.00\n";
cout << "12) HOT/ICED LATTE\t\t\t\tRM3.50/RM4.00\n";
cout << "13) HOT/ICED CHOCOLATE\t\t\t\tRM4.00/RM 4.50\n";
cout << "14) HOT/COLD WHITE COFFEE\t\t\tRM4.00/RM 4.50\n";
cout << "15) HOT/ICED MILO\t\t\t\tRM4.00/RM4.50\n";
cout <<
"*============================================================
========================================================*\n\
n";

cout <<
"*============================================================
========================================================*\n";
cout << "COMBO SNACK\t\t\t\t\t\t\t\t\t\tPRICE\n";
cout <<
"*============================================================
========================================================*\n";
cout << "A] 1x POPCORN (M), 1x SOFT DRINK or MINERAL WATER\t\
t\t\t\tRM5.50\n";
cout << "B] 1x POPCORN (L), 1x SOFT DRINK or MINERAL WATER\t\
t\t\t\tRM7.50\n";
cout << "C] 1x POPCORN (S), 2x SOFT DRINK or MINERAL WATER, 1x
CHICKEN NUGGET (6PCS)\t\tRM15.00\n";
cout << "D] 1x POPCORN (S), 2x SOFT DRINK or MINERAL WATER, 1x
HOTDOG\t\t\t\tRM12.00\n";
cout << "E] 1x CHICKEN NUGGET (6PCS), 1x SOFT DRINK or MINERAL
WATER\t\t\t\tRM10.00\n";
cout << "F] 1x HOT DOG, 1x SOFT DRINK or MINERAL WATER\t\t\t\
t\t\tRM7.50\n";

66
cout << "G] 1x RED VELVET or CHOCOLATE POPCORN, 1x SOFT DRINK
or MINERAL WATER\t\t\tRM11.00\n";
cout << "H] 1x SAUSAGES (8PCS), 1x SOFT DRINK or MINERAL
WATER\t\t\t\t\tRM11.50\n\n";
cout <<
"*=============================================================
=======================================================*\n\n";

cout <<
"*=====================================================*\n";
cout << "ADD-ONS\t\t\t\tPRICE\n";
cout <<
"*=====================================================*\n";
cout << "1) FRIES (S)\t\t\tRM3.00 EACH\n";
cout << "2) POPCORN IN A CUP\t" "\n";
cout << "3) SAUSAGES (5PCS)\t" "\n";
cout <<
"-------------------------------------------------------\n";
cout << "4) HOTDOG\t\t\tRM5.00 EACH\n";
cout << "5) CHICKEN NUGGET (5PCS)\t" "\n";
cout << "6) MEATBALLS (5PCS)\t" "\n";
cout <<
"*=====================================================*\n";
}

bool isValidDate(const string& date) {


if (date.length() != 5 || date[2] != '/') {
return false;
}
if (!isdigit(date[0]) || !isdigit(date[1]) || !
isdigit(date[3]) || !isdigit(date[4])) {
return false;
}
int day = (date[0] - '0') * 10 + (date[1] - '0');
int month = (date[3] - '0') * 10 + (date[4] - '0');

67
if (day < 1 || day > 31 || month < 1 || month > 12) {
return false;
}
return true;
}

5.0 SAMPLE OF OUTPUT


Images below shows the output of our program :

1. Register , Login and Admin

68
At first , our program will ask user to register or login to enter to our system . If they are
admin , they can choose number 3 . The sample of output shows that if user enter 1
(Register) as their choice .

This is the example if user enter 2 (Login) after the registration succeed.

69
This is the example if user enter 3 (Admin) . To access the admin tools , users need key in
the admin code . This admin tools are use for the cinema admin to change promocode ,
movies and more .

2. Movie Selection

Back to our main program , the program will ask user to choose their Movie and movie
quality based on the movie table given . Then , the program will ask user to enter the
number of adult , child and senior to confirm their amount of ticket .

70
3. Food Selection

After that , the program will ask user to choose their Food and Snack . We provide Food and
Snack table to gave users choices .

4.Movie Date , Time , Promo and Payment

Then , the program will ask user to choose their date . Some date are program as certain
special promo based on our special celebrations such as Chinese New Year , Deepavali ,
Christmas and so on . For users who have a promo code , a student or OKU , they will get a
special discount too . After that , user can choose either they want to pay with E-Wallet or
Credit/Debit Card .

71
5. Receipt ( Ticket and Total Price )

Lastly , the program will display the official receipt for customer . It will include the total price
for ticket , food and beverage and total price after tax . Also , the customer’s selected movie ,
movie quality , selected date and showtime are also shown on receipt .

6.0 Discussion/Conclusion
This system started by display choices to user as if they want to make a new account
that are carried by the registration function or log in to the ticketing system by login function.
They are required to enter their name and create a password for their account. After get
through the registration part, users will be displayed all the movies list along with the ticket
prices based on the categories (adult, children, senior or OKU) and the screen quality
(normal, Imax or 3D). Users are needed to enter their movie selection, screen quality and
quantity of the tickets. After that, users will also be displayed the foods and beverages list
along with its price and sizes by the foodMenu function. While the snackSelect function
required the users to make choices for the food and drinks followed by the selection of the
combo snack that are carried by the comboSelect function and the price of the food selected
will be calculated by the function calcFoodPrice. In addition, discounts are applied by any
special occasion or student or special promo code. Lastly, for the payment, users are given
two choices which either by using e-Wallet or debit\credit card. The total prices of all the
selection made by the consumers will be calculated in the function named calcTotalAmount.
In conclusion, the problems that arose with the previous old system were resolved by
our system. The time it takes for one individual to buy cinema tickets will be reduced by this
system. Hence, the waiting time has been reduced significantly. The new system may have
a high initial cost, but its ongoing operating and maintenance costs will be significantly
cheaper, bringing down the total cost. The automated system has also reduced the amount
of human resources needed to operate it. Additionally, consumers will be able to buy tickets
easily and without any difficulties of spoken transactions partly due to the system's output
screen. Last but not least, the absence of a cashier to conduct transactions will minimise the
amount of work.

72

You might also like