You are on page 1of 41

CSC128 Fundamentals of

Computer Problem Solving

GROUP PROJECT REPORT


Title: HIJJAZ WESTERN
RESTAURANT MANAGEMENT
Group: CS1122B

Student ID: 2020600658


Name: AZIZUL HAKIM BIN NASHABUDIN
Student ID: 2020469928
Name: MUHAMMAD AQIL DANISH BIN SAAD RONI
Student ID: 2020842642
Name: MOHAMED HADRI BIN MOHD AZMI
Student ID: 2020851554
Name: ARIF SUFFIAN BIN AZLAN

Date Submitted: 1 0 0 7 2 0 2 1

1
Table of Contents

EXECUTIVE SUMMARY ................................................................................................... 3


PSEUDOCODE ................................................................................................................. 5
FLOWCHART ................................................................................................................. 16
LIST OF CODES ............................................................................................................. 33
List of functions ............................................................................................................ 33
List of Repetition in Main .............................................................................................. 35
DETAILS INPUT AND OUTPUT ..................................................................................... 37
SCREEN LAYOUT .......................................................................................................... 38
REFERENCES ................................................................................................................ 41

2
EXECUTIVE SUMMARY

PROJECT TITLE

Hijjaz Western Restaurant Management

PROJECT BACKGROUND

In Hijjaz Western Restaurant, we applied the same concept as popular fast-food franchise that
origins from United States of America, Mc Donald, where the self-order system, where
customer input their order by themselves by using machines. Our staff, may help them to
assist on doing so. If the customer is first timers, we have already included the tutorial on how
to order by themselves at the beginning of the program. Customer may choose to not watch
the tutorial by input value other than 0. The first question that we ask from the customer is
their details like name and number of their seated tables. Next, we will first ask the customer
for its membership. If the customer said yes(Y), the customer will be given special discount
for members only by 15%. If No(N) is the answer, there will be not given any discount as it
only referred to only members. There are total of 4 types of main menus or dishes or it can be
also referred as packages (package A, package B, package C and package D) where in every
package, there is a main dish, desert, salads, and also a beverage.

Customer will choose their preferred package and its quantity. For example, customer want
to order three set of package A, thus, the user will input 3 (value) for package A. The input
value entered by user is representing the quantity ordered by the customer. The quantity of
ordered received will be multiplied by packages’ price. The given formula is used,
total=package*price. Next, the customer will be asked if they want to have another package,
if the customer want to do so, input ‘Y’ which indicates as Yes. Meanwhile, if customer wish
to not to order another package, the customer may input ‘N’ which indicates No. This question
will be asked until the customer input ‘N’ which indicates no to the question whether they want
to add another package.

Moreover, there are also add-ons items, where additional items such as rice, coke, plain water
and ice cream will be displayed in this category. First, the customer will be asked whether they
want any add-ons items. If they answer No(N) they will display straight to the bills, which is
the final step of this display. Else, if they answer Yes(Y), they will be asked what add on items
they want either rice(R), coke (C), plain water (P) and ice cream (I). Next, they will be asked
to put the quantity of their chosen items. Then once again, they will be asked if they want to
order another add on items, and the concept is the same as looping system in package where
customer may input ‘Y’ for yes to the question and ‘N’ for no for adding another add on items.

Moving on to the next subject, display of receipt. The receipt will first display their details that
the customer already filled early on. Then, it will display what package and what items for add-
on category that customers ordered. There is total of 4 price that need to be checked and
added for the total Overall, which is the total price that the customer need to pay. First is the
subtotal, the total of all the unit or items price multiply by the quantity ordered. SST is referring
to the service tax which is 8% of the subtotal. Next is discount price, this section is referred to
the 15% discount that members can received. If the customer is not the member of Hijjaz
Western Restaurant, no discount will be received. Lastly, the totalOverall which is the total

3
price that customer need to pay. This results from adding up the subtotal and SST, while
deduct discount received by the customer. Thus, produce the totalOverall.

Next, step is proceeding to the next customer. If the input is yes, the system will restart the
program to refresh for the next customer. Meanwhile, if No is the answer, it will show the total
amount of customer for the day, the total package ordered by category A, B, C and D. Only
staff is allowed to input N or no, because it will show the Hijjaz Western Restaurant total
achievement for the day.

OBJECTIVE

• to display the menu of our Hijjaz Western Restaurant automatically


• to ease our customer to get their self-services high quality ordering system in our
western restaurant’s menu
• to display the receipt from the customer’s order by using programming technique.
• to display the amount of package ordered by the end of the day

PROJECT MENU

PACKAGE A PACKAGE B PACKAGE C PACKAGE D ADD-ON


RM 115 RM135 RM125 RM145

CHICKEN LAMB CHOP GRILLED BLACK RICE


CHOP CHICKEN PEPPER (RM2.00)
STEAK
CHOC CHOCPEANUT SUNNY CHETA’S COKE
CUPCAKES PIE CREAMERY BROWNIE (RM2.50)

HARVEST TACO SALAD GARDEN MACARONI PLAIN WATER


SALAD SALAD SALAD (RM2.00)

BERRY LEMONADE MOCHA ORANGE ICE CREAM


SMOOTHIE MILKSHAKE SMOOTHIE (RM4.00)

4
PSEUDOCODE
1) Function randomOrderCode()
1. Start
2. Get random number
3. Set range (000000-999999)
4. return Code
5. End

2) Function packageMenu()
1. Start
2. Display “LIST OF PACKAGE”
3. End

3) Function addOnMenu()
1. Start
2. Display "LIST OF ADD-ONS”
3. End

4) Function DisplayMenu(time)
1. Start
2. Display “WELCOME TO HIJJAZ(JAWI)
3. Display “HIJJAZ WESTERN RESTAURANT OPENING EVERYDAY, EVERYTIME,
EVERYWHERE”
4. Display Menu
5. End

5) Function tutorial()
1. Start
2. Display tutorial
3. End

6) Function MemberCard(Member)
1. Start
2. if (Member == ‘Y’ || Member == ‘y’)
Display “YOU WILL RECEIVED 15% DISCOUNT!”
else if (Member == ‘N’ || Member == ‘n’)
Display “ITS OKAY, WE’LL PROCEED TO YOUR ORDER 😊”
else
Display “INVALID CHOICE, PLEASE TRY AGAIN”
3. End

7) Function memberDiscount(Member)
1. Start
2. if (Member == ‘Y’ || Member == ‘y’)
return 0.15
else
return 0
3. End

5
8) Function traceAddOn(AddOn)
1. Start
2. Set ADDON [] = {‘R’, ‘C’, ‘P’, ‘I’}
Set addon [] = {‘r’, ‘c’, ‘p’, ‘i’}
3. i=0
4. while (i<5)
if (AddOn == ADDON[i] || AddOn == addon[i])
temp=i
endwhile

i=i+1

5. return temp
6. End

9) Function totalAddOn(temp, quantity)


1. Start
2. Set priceADDON [] = {2.00, 2.50, 2.00, 4.00}
3. return priceADDON[temp]*quantity
4. End

10) Function singleAddOnPrice(temp)


1. Start
2. Set priceADDON [] = {2.00, 2.50, 2.00, 4.00}
3. return priceADDON[temp]
4. End

11) Function errorName(name, table)


1. Start
2. Display “PLEASE ENTER YOUR NICKNAME : “
3. Display “PLEASE ENTER YOUR TABLE NO. : “
4. End

12) Function errorMember(member)


1. Start
2. Display “ARE YOU A MEMBER? ( Y / N ) : “
3. End

13) Function displayError(space)


1. Start
2. Display “INVALID CHOICE, PLEASE TRY AGAIN”
3. End

6
14) Function errorPackage(resetCounter, PackageOrder[], quantityPackageOrder[],
addPackage[])
1. Start
2. i=0
3. while(i<resetCounter)
Display “PLEASE ENTER YOUR PACKAGE : “
Display “PLEASE ENTER THE QUANTITY : “
Display “DO YOU WANT TO ADD ANOTHER PACKAGE? (Y/N) : “
endwhile

i=i+1

4. End

15) Function addAnotherPackage(resetCounter, PackageOrder[], quantityPackageOrder[],


addPackage, PackageCounter)
1. Start
2. i=0
3. while(i<PackageCounter)
Display “PLEASE ENTER YOUR PACKAGE : “
Display “PLEASE ENTER THE QUANTITY : “
if(i<resetCounter)
Display “DO YOU WANT TO ADD ANOTHER PACKAGE? (Y/N) : “
endwhile
4. i=i+1
5. End

16) Function loading(string message)


1. Start
2. Display “Loading Icon’
3. End

7
17) Function Main
1. Start
do
Display “If you’re first-timer, simply type 0 to watch tutorial!”
Display “Answer: ”
Get option
if (option == 0)
Call Function tutorial()
else
Reset screen
Call Function Display Menu(time)
Display “PLEASE ENTER YOUR NICKNAME : “
Get name
Display “PLEASE ENTER YOUR TABLE NO. :”
Get table
while(true)
Display “ARE YOU A MEMBER? (Y/N) : “
Get Member
if (Member != 'Y' && Member != 'y' && Member != 'N' && Member !=
'n')
call Function displayError()
call Function DisplayMenu(time)
call Function errorName(name, table)
else
call Function MemberCard(Member)
endwhile
while(true)
while(true)
Display “PLEASE ENTER YOUR PACKAGE: “
Get Package
If (Package!='A' && Package!='a' && Package!='B' &&
Package!='b' && Package!='C' && Package!='c' &&
Package!='D' && Package!='d' )
call Function displayError()
call Function DisplayMenu(time)
call Function errorName(name, table)
call Function errorMember(Member)
call Function packageMenu()
call Function errorPackage(resetCounter, PackageOrder[],
quantityPackageOrder[], addPackage[])
else
PackageOrder[PackageCounter]= Package
PackageCounter++
endwhile

Display “PLEASE ENTER THE QUANTITY: “

Get quantity

8
quantityPackageOrder[quantityPackageCounter]=quantity

quantityPackageCounter++

if (Package=='A' || Package=='a')

dayA=dayA+quantity

else if (Package=='B' || Package=='b')

dayB=dayB+quantity

else if (Package=='C'|| Package=='c')

dayC=dayC+quantity

else if (Package=='D'|| Package=='d')

dayD=dayD+quantity
while (true)

Display “DO YOU WANT TO ADD ANOTHER PACKAGE?


(Y/N): “

Get Choice

if (Choice!='Y' && Choice!='y' && Choice!='N' && Choice!='n')

Call Function DisplayError()

Call Function Displaymenu(time)

Call Function errorName (name, table)

Call Function errorMember (Member)

Call Function packageMenu()

Call Function addAnotherPackage(resetCounter,


PackageOrder,quantityPackageOrder,addPackage,Pac
kageCounter)

else

resetCounter++

addPackage[addPackageCounter]=Choice

addPackageCounter++

endwhile

if (Choice == ‘Y’ || Choice == ‘y’)

continuewhile

9
else if (Choice == ‘N’ || Choice == ‘n’)

resetCounter=0;

endwhile

while (true)

Display “DO YOU WANT ADD-ON? (Y / N) : "

Get Choice

if (Choice!='Y' && Choice!='y' && Choice!='N' && Choice!='n')

Call Function DisplayError()

Call Function Displaymenu(time)

Call Function errorName (name, table)

Call Function errorMember (Member)

Call Function packageMenu()

else

endwhile

if (Choice == ‘Y’ || Choice == ‘y’)

Call Function DisplayMenu(time)

Call Function addOnMenu

do

while (true)

Display “PLEASE ENTER YOUR ADD-ON:”

Get addon

if (addon!='R' && addon!='r' && addon!='C' &&


addon!='c' && addon!='P' && addon!='p' && addon!='I'
&& addon!='i')

Call Function displayError()

Call Function DisplayMenu (time)

Call Function addOnMenu

i=0

while (i<AddOnCounter)

10
Display “PLEASE ENTER YOUR ADD-
ON :”

Display “PLEASE ENTER THE


QUANTITY OF “

Display “DO YOU WANT TO ADD


ANOTHER ADD-ON? (Y/N):

else

AllAddOn[AddOnCounter] = addon

AddOnCounter++

singlePriceAddOn[priceAddcounter]=singleAdd
OnPrice(traceAddOn(addon))

priceAddcounter++

endwhile

Display “PLEASE ENTER THE QUANTITY OF”

Get quantityAddOn

addOnquantity[addCounter]=quantityAddOn

addCounter++

Calculate

totalAdd = totalAdd +
totalAddOn(traceAddOn(addon),quantityAddOn)

while (true)

Display “DO YOU WANT TO ADD ANOTHER ADD-


ON? (Y/N)”

Get AnotherChoice

If (AnotherChoice!='Y' && AnotherChoice!='y'


&&AnotherChoice!='N' &&AnotherChoice!='n')

Call Function displayError()

Call Function DisplayMenu(time)

Call Function addOnMenu()

i=0

while (i<AddOnCounter)

11
Display ‘PLEASE ENTER YOUR ADD-
ON:“

Display “PLEASE ENTER THE


QUANTITY OF”

if (i<resetCounter)

Display “DO YOU WANT TO


ADD ANOTHER ADD-ON? (Y/N)

else

anotherAddOn[test]=AnotherChoice

test++

resetCounter++

endwhile

while (AnotherChoice!='N' && AnotherChoice!='n')

i=0

while (i<Packagecounter)

j=0

while (j<4)

if(PackageOrder[i]==userPackageUp[j]||PackageOrder[i]==use
rPackageLow[j])

alpha[i]=userPackageUp[j]

if (alpha[i]=='A')

Aa=Aa+quantityPackageOrder[i]

check[0]=true

else if (alpha[i]=='B')

Bb=Bb+quantityPackageOrder[i]

check[1]=true

else if (alpha[i]=='C')

Cc=Cc+quantityPackageOrder[i]

check[2]=true

else if (alpha[i]=='D')

12
Dd=Dd+quantityPackageOrder[i]

check[3]=true

finalquantity[0]=Aa

finalquantity[1]=Bb

finalquantity[2]=Cc

finalquantity[3]=Dd

i=0

while (i<4)

if (check[i])

PackageOrder[j]=arrletter[i]

quantityPackageOrder[j]=finalquantity[i]

singlePriceArray[j]=pricePackage[i]

j++

i=0

while (i<AddOnCounter)

if (AllAddOn[i]=='R' || AllAddOn[i]=='r')

displayAddOn[i]="RICE"

else if (AllAddOn[i]=='C' || AllAddOn[i]=='c')

displayAddOn[i]="COKE"

else if (AllAddOn[i]=='P' || AllAddOn[i]=='p')

displayAddOn[i]="PLAIN WATER"

else if (AllAddOn[i]=='I' || AllAddOn[i]=='i')

displayAddOn[i]="ICE CREAM"

Display name

Display randomOrderCode()

Display table

Display “QUANTITY”

Display “PACKAGE”

13
Display “UNIT PRICE”

Display “TOTAL”

i=0

while (i<j)

Display quantityPackageOrder[i]

Display PackageOrder[i]

Display singlePriceArray[i]

Calculate singlePriceArray[i]*quantityPackageOrder[i]

Calculate subtotal=subtotal+singlePriceArray[i]*quantityPackageOrder[i]

if (AddCounter != 0)

Display “ADD-ON”

i=0

Display addOnquantity

Display displayAddOn[i]

Display singlePriceAddOn[i]

Calculate singlePriceAddOn[i]*addOnquantity[i]

Calculate subtotal = subtotal + singlePriceAddOn[i]*addOnquantity[i]

Calculate sst=0.08*subtotal

Calculate totalOverall=sst+subtotal-subtotal*memberDiscount(Member)

Display subtotal

Display sst

Display subtotal*memberDiscount(Member)

Display totalOverall

Display “Next Customer? (Y/N) : “

Get nextchoice[8]

customercount++

while (nextchoice[8] !='N'&& nextchoice[8] !='n')

14
2. Display Order Data
i. customercount
ii. dayA
iii. dayB
iv. dayC
v. dayD
3. End

15
FLOWCHART

1) Function randomOrderCode()

Start

Get random number

Set range (000000-999999)

Return Code

End

2) Function packageMenu()

Start

Display “LIST OF PACKAGE”

End

3) Function addOnMenu()

Start

Display LIST OF ADD-ONS

End

16
4) Function DisplayMenu(time)

Start

Display “WELCOME TO HIJJAZ(JAWI)

Display “HIJJAZ WESTERN RESTAURANT


OPENING EVERYDAY, EVERYTIME,
EVERYWHERE”

Display Menu

End

5) Function tutorial()

Start

Display tutorial

End

6) Function MemberCard(Member)

Start

If(Member == ‘Y’ || Y Display “YOU WILL RECEIVED


Member == ‘y’) 15% DISCOUNT!”

If(Member == ‘N’ || Y Display “ITS OKAY, WE’LL PROCEED


Member == ‘n’) TO YOUR ORDER 😊“

Display “INVALID CHOICE,


PLEASE TRY AGAIN”

End

17
7) Function memberDiscount(Member)

Start

Y
If(Member == ‘Y’ || return 0.15
Member == ‘y’)

return 0

End

8) Function traceAddOn(AddOn)

Start

Set ADDON [] = {‘R’, ‘C’, ‘P’, ‘I’}

Set addon [] = {‘r’, ‘c’, ‘p’, ‘i’}

i=0

N
while (i < 5)

If(AddOn == ADDON[i] Y
temp = i
|| AddOn == addon[i] )

N return temp

i=i+1 break

End

18
9) Function totalAddOn(temp, quantity)

Start

Set ADDON [] = {2.00, 2.50, 2.00, 4.00}

return priceADDON[temp]*quantity

End

10) Function singleAddOnPrice(temp)

Start

Set priceADDON [] = {2.00, 2.50, 2.00, 4.00}

return priceADDON[temp]

End

11) Function errorName(name, table)

Start

Display “PLEASE ENTER YOUR NICKNAME : ”

Display “PLEASE ENTER YOUR TABLE NO : ”

End

19
12) Function errorMember(member)

Start

Display “ARE YOU A MEMBER? (Y/N) : ”

End

13) Function displayError(space)

Start

Display “INVALID CHOICE, PLEASE TRY AGAIN”

End

14) Function errorPackage(resetCounter, PackageOrder[], quantityPackageOrder[],


addPackage[])
Start

i=0

N
while (i < resetCounter)

Display “PLEASE ENTER YOUR PACKAGE : ”

Display “PLEASE ENTER THE QUANTITY : ”

Display “DO YOU WANT TO ADD ANOTHER


PACKAGE? (Y/N) : ”

i=i+1

End

20
15) Function addAnotherPackage(resetCounter, PackageOrder[], quantityPackageOrder[],
addPackage, PackageCounter)
Start

i=0

N
while (i < PackageCounter)

Display “PLEASE ENTER YOUR PACKAGE:”

Display “PLEASE ENTER THE QUANTITY:”

N
(i < resetCounter)

Display “DO YOU WANT TO ADD


ANOTHER PACKAGE? (Y/N) : ”

i=i+1

End

16) Function loading(string message)

Start

Display “Loading Icon”

End

21
17) Function main

Start

Display “If you’re first timer, simply type 0 to watch tutorial!”

Display “Answer: ”

Get option

Y
If( option == 0) Call Function tutorial()

Reset screen

Call Function Display Menu(time)

Display “PLEASE ENTER YOUR NICKNAME : ”

Get name

Display “PLEASE ENTER YOUR TABLE NO : ”

Get table

while (true)

Display “ARE YOU A MEMBER? (Y/N) : ”

Get member

If( Member != 'Y' && Member != 'y' && Y


Call Function displayError()
Member != 'N' && Member != 'n’ )

N Call Function DisplayMenu(time)

Call Function MemberCard(Member)

Call Function errorName (name, table)

break

k a

22
k a

while (true)

while (true)

Display “PLEASE ENTER YOUR PACKAGE : ”

Get Package

if (Package!='A' && Package!='a' &&


Package!='B' && Package!='b' && Y Call Function displayError()
Package!='C' && Package!='c' &&
Package!='D' && Package!='d' )

Call Function DisplayMenu(time)

N
Call Function errorName (name, table)

PackageOrder[PackageCounter]= Package
Call Function errorMember (Member)

Call Function packageMenu()

PackageCounter ++ Call Function errorPackage(resetCounter, PackageOrder[],


quantityPackageOrder[], addPackage[])

break

Display “PLEASE ENTER THE QUANTITY : ”

Get Quantity

quantityPackageOrder[quantityPackageCounter]=quantity

quantityPackageCounter ++

k n b

23
b
k n

if(Package == ‘A’ Y
dayA = dayA+quantity
|| Package == ‘a’)

if(Package == ‘B’ Y
dayB = dayB+quantity
|| Package == ‘b’)

if(Package == ‘C’ Y
dayC = dayC+quantity
|| Package == ‘c’)

Y
if(Package == ‘D’ dayD = dayD+quantity
|| Package == ‘d’)

while (true)

Display “DO YOU WANT TO ADD


ANOTHER PACKAGE? (Y/N) : ”

Get Choice

if (Choice!='Y' && Choice!='y' Y


Call Function DisplayError()
&& Choice!='N' && Choice!='n' )

N Call Function DisplayMenu(time)

resetCounter++
Call Function errorName (name, table)

Call Function errorMember (Member)

addPackage[addPackageCounter]=Choice

Call Function packageMenu()

Call Function
addPackageCounter ++ addAnotherPackage(resetCounter,
PackageOrder,quantityPackageOr
der,addPackage,PackageCounter)

k n c

24
c
k n

break

Y
continue if (Choice == ‘Y’ ||
Choice == ‘y’)

Y
resetCounter = 0 if (Choice == ‘N’
|| Choice == ‘n’)

break

while (true)

Display “DO YOU WANT ADD ON? (Y / N) : ”

Get Choice

if (Choice!='Y' && Choice!='y' Y


Call Function DisplayError()
&& Choice!='N' && Choice!='n' )

Call Function DisplayMenu(time)

Call Function errorName (name, table)


N

Call Function errorMember (Member)

break Call Function packageMenu()

if (Choice == ‘Y’ ||
Call Function DisplayMenu(time)
Choice == ‘y’)

Call Function addOnMenu

k d

25
d
k

while (true)

Display “PLEASE ENTER YOUR ADD-ON : ”

Get addon

if (addon!='R' && addon!='r'


&& addon!='C' && addon!='c' Y
Call Function displayError()
&& addon!='P' && addon!='p'
&& addon!='I' && addon!='i')

Call Function DisplayMenu(time)


N

AllAddOn[AddOnCounter] = addon Call Function addOnMenu()

i=0
AddOnCounter ++

while (i <
AddOnCounter)
singlePriceAddOn[priceAddcounter]=si
ngleAddOnPrice(traceAddOn(addon)

Display “PLEASE ENTER


YOUR ADD-ON : ”

priceAddCounter ++

Display “PLEASE ENTER


THE QUANTITY OF ”

Display “DO YOU WANT TO ADD


break ANOTHER ADD-ON? (Y/N) : ”

Display “PLEASE ENTER THE QUANTITY OF ”

Get quantityAddOn

addOnquantity[addCounter]=quantityAddOn

k m e

26
e
k m

addCounter ++

totalAdd = totalAdd + totalAddOn(traceAddOn(addon),quantityAddOn)

while (true)

Display “DO YOU WANT TO ADD ANOTHER ADD ON? (Y/N) : ”

Get AnotherChoice

if (AnotherChoice!='Y'
&& AnotherChoice!='y' Y
Call function displayError()
&&AnotherChoice!='N'
&&AnotherChoice!='n')

N Call function DisplayMenu(time)

anotherAddOn[test]=AnotherChoice
Call function addOnMenu()

test++
i=0

resetCounter ++

while (i <
AddOnCounter)

Display “PLEASE ENTER YOUR ADD-ON : ”

Display “PLEASE ENTER THE QUANTITY OF ”

N
if ( i< resetCounter)

break
Display “DO YOU WANT TO ADD
ANOTHER ADD ON? (Y/N) : ”

k f i = i+1
m

27
m f
k

while (AnotherChoice!='N'
&& AnotherChoice!='n')

i=0

while (i<Packagecounter)

j=0

while (i<4)

if(PackageOrder[i]==userPackageUp[j]||
PackageOrder[i]==userPackageLow[j]

alpha[i]=userPackageUp[j]

Y
if (alpha[i]=='A') Aa=Aa+quantityPackageOrder[i] Check[0] = true

Y
if (alpha[i]=='B') Bb=Bb+quantityPackageOrder[i] Check[1] = true

Y
if (alpha[i]=='C') Cc=Cc+quantityPackageOrder[i] Check[2] = true

Y
if (alpha[i]=='D') Dd=Dd+quantityPackageOrder[i] Check[3] = true

finalquantity[0]=Aa

k g

28
g
k

finalquantity[1]=Bb

finalquantity[2]=Cc

finalquantity[3]=Dd

i=0

while (i<4)

if (check[i])

PackageOrder[ j ]=arrletter[i]

quantityPackageOrder[ j ]=finalquantity[i]

singlePriceArray[ j ]=pricePackage[i]

j++

i=0

while (i<AddOnCounter)

k h

29
k h

if (AllAddOn[i]=='R' Y
displayAddOn[i]="RICE"
|| AllAddOn[i]=='r')

if (AllAddOn[i]=='C' Y
|| AllAddOn[i]=='c') displayAddOn[i]="COKE"

if (AllAddOn[i]=='P' Y
displayAddOn[i]="PLAIN WATER"
|| AllAddOn[i]=='p)

if (AllAddOn[i]=='I' Y displayAddOn[i]="ICECREAM"
|| AllAddOn[i]=='i')

Display name

Display randomOrderCode()

Display table

Display “QUANTITY”

Display “PACKAGE”

Display “UNIT PRICE”

Display “TOTAL”

k
i

30
i
k

i=0

while (i<j)

Display quantityPackageOrder[i]

Display PackageOrder[i]

Display singlePriceArray[i]

singlePriceArray[i]*quantityPackageOrder[i]

subtotal=subtotal+singlePriceArray[i]*quantityPackageOrder[i]

if (AddCounter != 0)

Display “ADD-ON”

i=0

Display addOnquantity

Display displayAddOn[i]

Display singlePriceAddOn[i]

singlePriceAddOn[i]*addOnquantity[i]

subtotal = subtotal + singlePriceAddOn[i]*addOnquantity[i]

k j

31
k j

sst=0.08*subtotal

totalOverall=sst+subtotal-subtotal*memberDiscount(Member)

Display subtotal

Display sst

Display subtotal*memberDiscount(Member)

Display totalOverall

Display “Next Customer? (Y/N) : “

Get nextchoice[8]

customercount++

Y while (nextchoice[8]
!='N'&& nextchoice[8] !='n')

Display customercount

Display dayA

Display dayB

Display dayC

Display dayD

End

32
LIST OF CODES

1. List of functions

No Function Definition Function to: Parameter


1 int randomOrderCode() To produce random order code
for the customer’s bills

2 void packageMenu() To display the code used for


the packages (A, B, C, D)

3 void addOnMenu() To display the add-on items


code such as R, C, P and I.

4 void DisplayMenu(int time) To display the menu and (int time)


dishes in packages and display
welcome board.
5 void tutorial () To display the guides and
steps on how to order to the
first-timer customers.
6 void MemberCard(char To check whether the (char Member)
Member) customer is member or not
member customer.
7 double memberDiscount(char To return discount value of (char Member)
Member) 15% to the members and none
to not members.
8 int traceAddOn(char AddOn) To adjust the sequence of the (char AddOn)
add-on items on receipt if
being ordered randomly
sequence.
9 double totalAddOn(int temp,int To make sure the correct unit (int temp,int quantity)
quantity) price for the items in add-ons
category correctly placed.
10 double singleAddOnPrice(int To display the price of add-on (int temp)
temp) items in the correct sequence
for the receipt.
11 void errorName(string name,int To display back the customer’s (string name,int table)
table) name and table number if reset
from error occurred.
12 void errorMember(char To display back the customer (char member)
member) membership confirmation if
reset from error occurred.
13 void displayError(int space) To display message whenever (int space)
wrong codes being typed by
customer and reset.
14 void errorPackage(int To display back customer’s (int resetCounter,char
resetCounter,char order for package and quantity PackageOrder[],int
PackageOrder[],int

33
quantityPackageOrder[],char when error reset occur during quantityPackageOrder[],char
addPackage[]) the second codes for package. addPackage[])

15 void addAnotherPackage(int To display back customer’s (int resetCounter,char


resetCounter,char order for package and quantity PackageOrder[],int
PackageOrder[],int when error reset occur during quantityPackageOrder[],char
quantityPackageOrder[],char adding another package addPackage[],int
addPackage[],int confirmation question. PackageCounter)
PackageCounter)
16 void loading(string message) To display loading icon. (string message)

34
2. List of Repetition in Main

No. Repetition Lines Function to:

1 Do while loop 369 Proceed to the next customer or display the total order by
package and to display the total customer ordered for the day.

528 To loop the inside loop if customers want to add another add-
on items.
2 While loop 410 To loop whenever wrong codes aside from Y and N being input
occur. Reset back the question for membership.
430 To loop the loop inside it if customer choose to add another
package. It will show the same question to input the codes and
quantity back.

432 To reset the loop if wrong codes aside from (A, B, C, D) being
the input. Reset back to ask the customer which package do
they want to order.

474 To loop whenever wrong codes aside from Y and N being input
occur. Reset back the question whether customer want to add
another package.

506 To loop whenever wrong codes aside from Y and N being input
occur. Reset back the question for asking whether customers
want add-on items.

530 To loop whenever wrong codes aside from (R, C, P, I) being


input occur. Reset back the question for customers to put the
correct codes for add-on items.

563 To loop whenever wrong codes aside from Y and N being input
occur. Reset back the question for customers whether to add
another add-on items.
3 For loop main 539 To loop back previous input after the reset question from
putting the wrong codes for the add-on items.
573 To loop back previous input after the reset question from
putting the wrong codes for asking whether customers want to
add another the add-on items.
595 To check the sequence of ordered package recorded and
display correctly (A, B, C, D)
597 To check if user put lower case when ordering to be the same
as upper case. (Package)
629 To display package order on receipt if exist

639 To check if user put lower case when ordering to be the same
as upper case, with the correct sequence. (add-on)

35
673 If Plain water or Ice cream order, the space will be different.
Mainly to make the receipt more organised and neater.
4 For loop in 41 The loop is function when another customer came in and thus
function definition produce another customer order code differently.
114 To make animation when Hijjaz Western Restaurant quotes
appeared on screen
149 To make animation and delay during tutorial (name)

156 To make animation and delay during tutorial (table number)

165 To make animation and delay during tutorial (membership)

176 To make animation and delay during tutorial (input package


code)
184 To make animation and delay during tutorial (input package
quantity)
193 To make animation and delay during tutorial (input another
package answer)
201 To make animation and delay during tutorial (input add on
question)
213 To make animation and delay during tutorial (input add on
code)
221 To make animation and delay during tutorial (input add on
quantity)
264 To make add on codes same on either upper case or lower
case to become one type of input to avoid redundant on receipt
306 To repeat and display again the customer’s name, table
number and answer for adding another package when reset
occur if customer input the wrong code in package selection.
317 To repeat and display again the customer’s name, table
number when reset occur if customer input the wrong code in
adding another package.
335 To make loading animation

36
DETAILS INPUT AND OUTPUT

INPUT OUTPUT
• option • AllAddOn
• name • fullADDON
• table • addOnquantity
• Member • anotherAddOn
• Package • quantityPackageOrder
• quantity • PackageOrder
• Choice • singlePriceArray
• addon • displayAddOn
• quantityAddOn • singlePriceAddOn
• AnotherChoice • subtotal
• nextchoice • sst
• totalOverall
• customercount
• dayA
• dayB
• dayC
• dayD

37
SCREEN LAYOUT

1. Output for tutorial (if user enter 0)

2. Output for greetings and package menu

38
3. Output display list of package code

4. Output display add-on code

39
5. Output display loading animation

6. Output customer receipt and next customer

40
REFERENCES

How do I write a receipt? (n.d.). Retrieved from informi: https://informi.co.uk/business-


administration/how-do-i-write-receipt

Hubbard, J. R. (2000). Schaum's Outlines, Programming with C++, Second Edition. The McGraw-Hills
Companies.

Malik, D. (2013). C++ Programming: From Problem Analysis to Program Design, Sixth Edition. Boston:
Cengage Learning.

Malik, D. (2017). C++ Programming, Program Design including Data Structures. Boston: Cengage
Learning.

Quick and Creative Western Menu. (n.d.). Retrieved from Unilever Food Solutions:
https://www.unileverfoodsolutions.com.my/en/chef-inspiration/knorr-for-western-food-
menu/quick-and-creative-western-menu.html

Receipts and Receipt reports. (n.d.). Retrieved from lightspeed: https://resto-


support.lightspeedhq.com/hc/en-us/articles/226404908-Receipts-and-Receipt-reports

41

You might also like