You are on page 1of 25

CSC 128

FUNDAMENTALS OF COMPUTER PROBLEM SOLVING

JCS1101N

C++ PROJECT
CAKE ORDER SYSTEM

GROUP MEMBER: AZWAN BIN TAULANI (2017241324)


NURHIDAYATUL NAJWA BINTI MOHD RASHIDI (2017254236)
NUR HAIRUNNISHA ATIKA BINTI RASIM (2017224846)

LECTURER’S NAME: CT MUNNIRAH NIESHA BINTI MOHD SHAFEE

SUBMISSION DATE: WEEK 14


CONTENTS

Bil. Topic Page


1.0 Introduction
1.1 Project Background 1-2
1.2 Objectives
1.3 Scope

2.0 Implementation
2.1 List of Repetition 3 – 10
2.2 List of Functions
3.0 Program Testing 11-21
4.0 Conclusion 22
5.0 CD pocket 23

6.0 Evaluation form 24


1.0 Introduction
1.1 Project Background

Our cake business, named Cake O’ Clock has had trouble with the ordering system. We’ve
received multiple complaints of this problem. Our slow ordering process has made other
customers in line leave for waiting too long. In order to fix this problem, we’ve decided to create
a new ordering system which would speed up the ordering process.
This system is to be made to help our customers pick their desired cakes with ease by
having our menu listed on screen for easy selection. This will speed up the process of taking
orders which will reduce the waiting time of our customers when waiting in line. Not only would
this help speed up the process of taking orders, but it would also help our cashier with the bill,
as the final payment of the order is automatically calculated. The calculation of the payment is
inclusive of 6% GST, and can give a 5% discount based on how many cakes were bought.
There are 3 types of cakes in our bakery such as cream cakes, cheese cakes and fruit
cakes. For the cream cakes we have Chocolate Indulgence, Black Forest and Red Velvet while
for the cheese cakes we have Raspberry Cheese, Oreo Cheese and New York Cheese cake.
Lastly, for the fruits cakes we have orange, banana and coconut. Next, we also provide topping
for our cakes such as chocolate chips, chocolate rice, fruits and nuts. The cakes size that we
have is 800g, 1kg and 1.5 kg.
There will also have an option for the customers to decide on whether to dine in or take
away.
In the system, selection statements will be used to allow customers to choose between
cake types, cake varieties, toppings, and cake sizes. It is also used for applying a 5% discount if
the requirements are met. It is also used to decide on whether to do a take away or dine in.
In the system, repetition statements will be used to allow calculations for each cake
selected in their order. Calculations will be made and shown at the end of the receipt as their
final payment. The 6% GST will be included in the final payment.

1
1.2 Objectives
 To calculate the value of quantity.
 To calculate the total price in every transaction.
 To calculate profit sales.
 To compute the total of sales in a day.
 To calculate tax and discounts.

1.3 Scope
Our cake business targets the residents of Segamat town, as our business is located there.
This system, however, targets the people who are busy and doesn’t like to wait for too long.

2
2.0 Implementation
2.1 List of Repetition
2.1.1 Repetition for do….while

do{
system("CLS");
for(;;)
{
openingDisplay();
cout<<"\nHow many cakes do you want to order? :";
cin>>cake;
:
:
for(;;)
{
cout<<"\nContinue[y:Yes, n:No]: ";
cin>>answer;
if((answer=='y')||(answer=='Y')||(answer=='n')||(answer=='N'))
{
break;
}
}
count=0;
}while ((answer=='y')||(answer=='Y'));

This do…while loop will execute body of statement loop first then test the loop
continuation condition. In our system we use this loop to repeat our order for another
customer. It makes our system more systematic. If the customer does not want to use
the system anymore it will display the total profit of our business in one day.

3
2.1.2 Repetition for while…loop

int count=0;
while (count<cake)
{
if (count!=0)

system("CLS");

cout<<endl;

rService=getService();

receipt(cakeSize, cakeType, vCake, decTopping, tType, rService,


totalPayment);

sum=sum+totalPayment;

count++;

This is while loop. Before enter the while loop we need to initialize the LCV (loop control
variables) which is cont=0. Then cake is used as its sentinel value where it will keep
repeating if the condition is true and execute if the condition is false. We also can update
the LCV by increase it to one. This repetition is used in this system to allow the customer
to buy more than one cake with different type of cake & varieties topping and sizes .

4
2.2 List of Functions

2.2.1 Functions with no return value and without parameter

void openingDisplay()

cout<<"\t\t\t\t\t\tWELCOME TO\n";

cout<<"Enter any key to continue...";

cin.get();

}
This function definition is to display Welcome to Cake O’ Clock.
This is to show that we are welcoming our customer to enter our
system. This function does not need to return any value.

void cakeDisplaySize(){

cout<<endl;

cout << "\t\t\t--------------------------------------------------\n " << endl;

This function is to display cake size. Cake size that we have are 0.8
kg,1.0 kg,1.5 kg. So customer can choose their desire size. This
function does not need to return any value.

5
void cakeDisplayType()

This function is to display cake type which is Cream Cake, Cheese Cake and Fruit
Cake. This allow customer to choose their favorite type of cake. This function
does not need to return any value.
void cakeVarietyA()
This function is to display variety of Cream Cake which is Chocolate Indulgence,
Black forest, Red Velvet. This allow customer to choose their desire variety of
cream cake. This function does not need to return any value.

void cakeVarietyB()

This function is to display variety of Cheese Cake which is Raspberry, Oreo, New
York. This allow customer to choose their desire variety of cheese cake. This
function does not need to return any value.

void cakeVarietyC()
This function is to display variety of Fruit Cake which is Orange, Banana,
Coconut. This allow customer to choose their desire variety of fruit cake. This
function does not need to return any value.

void cakeService()

This function is to display services that we provide to our customer which is dine
in or take away. The customer can choose either one without being charge in the
payment. This function does not need to return any value.

void cakeTopping()

This function is to display cake topping which is Chocolate Chips, Chocolate Rice
and Fruits & Nuts. This allow customer to choose their favorite cake topping if they
want. This function does not need to return any value.

6
2.2.2 Functions with no return value and with parameter

void receipt(int _cakeSize,char _cakeType[],char _vCake[],char


_decTopping[],char_tType[],char _tService[], float _totalPayment)

system("CLS");

cout<<"_______-----C A K E O ' C L O C K-----_______";

cout<<"\nEnter any key to continue...";

cin.get();

This function is to display receipt of the customer which receive 7 parameters. It make
the system more systematic by using this function. This function does not need to return
any value.

7
2.2.3 Functions with parameter passing by reference

void calcPayment(double cakeWeight,double cakePrice,double tax,double& payment){

payment=(cakeWeight+cakePrice)+((cakeWeight+cakePrice)*tax);

This function will receive cakeWeight, cakePrice , tax as its parameter and then calculate
the payment then return it through its parameter.

8
2.2.4 Functions with return value and without parameter

char* getService(){

char tService[20];

char service[5];

for(;;)

cout<<"What type of service do you want[DI:Dine


In,TA:TakeAway] ?\n";

cin>>ws;

cin.getline(service,5)

cout<<"\nInvalid Service Input. Please Re-enter Input.\n";

return tService;

This function will not receive any parameter but will return the tService in data type string to
the main program.

9
2.2.5 Function with return value and with parameter

double discount(int cake,double total){

double discount;

if(cake<2)

discount=total;

return discount;

This function receive cake and total as its parameter. This function is then calculate the
discount given if the requirement are met. Then the discount was returned back to the
main program.

10
05
3.0 Program Testing

Sample 1

INPUT

11
OUTPUT

12
Sample 2

INPUT

13
14
15
OUTPUT

16
Sample 3

INPUT

17
18
19
20
OUTPUT

21
4.0 Conclusion
The conclusion of this cake order system is that its boost up the ordering system from
slow to more coefficient and give the best services to our customer. Besides the customer
can choose their favourite cake without waiting too long on the line. This system also
calculate total of profit in one day which make our business more easier to record it in
business account. This system also make customer easier to choose what type of cake
they want to buy. Lastly this system also show the receipt of each transaction so that the
customer can rechecked back what cake they had bought. For the coming days, if the
system need some performance improvements we will try to upgrade it so that it can run
more smoothly and efficiently.

22
5.0 CD Pocket

23

You might also like