You are on page 1of 34

Computer

science
internal
assessment.

Name: Dimitri Mitchell

School: excelsior high school

Year: 2016

Year of exam:

Topic: Electronic lunch system

Problem definition
The excelsior education center was founded by Dr. Hon. Aston Wesley Powell on January 19,
1931 with five students on his verandah of his parents house in campell town Kingston. He
developed a community college to provide education, training and services from the cradle to the
grave. The exceed group of schools comprises of a pre-primary school, primary school, high
school, and a community college. Excelsior community college is the territory arm of the
excelsior education center while the high school is the secondary arm. The community college,
with adult education at the center, is a pilot project in the training of teachers for the secondary
school system which commenced in 1971. The secondary arm, the excelsior high school trains
and teaches students ages 12-19 core values and prepare them for external an internal
examinations.
The excelsior community college as well as the high school accepts thousands of students every
year as a result all the service provided to for the students must be in tip top shape. The cafeteria
of the high school and the college works under one franchise named mothers. However there is
a major problem that is found in the cafeteria. In both cafeteria it is congested hot and the speed
of services in ordering food is quite slow. This results in the college and high school students not
getting their lunches and are going to class late. A solution to this problem would be the
implementation of a electronic lunch system. Since the cafeteria at the high school and the
college working under one franchise the introduction of a lunch card which would be used in the
electronic system would be efficient as both college and high school students can get their
lunches at the respective places. This system works when each student inserts into the electronic
lunch system their lunch card which would open up that specific students lunch account. The
student would then enter their password to fully unlock their account. They would the select the
food item they want based off a lunch menu provided by the system. The value is then subtracted
from the students account balance which is present on the lunch card. This system would limit
the amount of time spent at the point of sale area thus decreasing the amount of persons in the
cafeteria at a set period of time and students would finally get their lunches on time.

Concept diagram

Studen
t

Lunch
Order lunch
Payment (lunch card)
Receipt

Lunc
h
syste

Structure chart
E.L.S
(ELECTRONIC LUNCH

Display welcome
screen

Main menu

Input data
(student)

Processing

Output data

Display
receipt

Display

Get customer
information

Store customer
data

Store
customer

Store
customer
order

Get customer
order

Store
customer
price

Store lunch
order for the
day

Store total
profit

Customer
information

Customer

Calculate
customer
order

Calculate
lunch orders
for the day

Calculate
total income

Entity Relationship Diagram


Electronic lunch
system

UNDER
TAKES

assigns

Lunch orders

Ticket servers

Program code

has

competences

#include<stdio.h>
#include<conio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include <unistd.h>
#include <time.h>

int array[100], x, z, w, swap;


int queue[5];
int k,c,b,d,e,n,p,number,choice;
int account=1000;
int price;
int total=400;
int count;
char response;
char y;
int admin;
void Enqueue();
void Dequeue();

//_____________________ENGINE OF MY
PROGRAM_______________________________________________
int main()
{
system("color C7"); //screen color
count=1;
printf("WELCOME TO \n ");
printf("****

****

\n ");

printf("** ** ** **
printf("**

**

**

printf("**

**

printf("**

**

printf("M

\n");

\n");
\n");
\n");

S\n\n");

printf("THE GREAT JAMACAN PATTY COMPANY\n");

printf("Loading");
Sleep(1000);
printf("#");
seconds to enhance loading
Sleep(1000);
printf("#");
Sleep(1000);
printf("#");
Sleep(1000);
printf("#");

// prints symbols after every second for four

printf("\n\nEnter your secret Number\n\n");


scanf("%d",&number);

if (number ==123)
{
system("cls");

//menu options

printf("\nSelect Option\n");
printf("\n1.Order Lunch\n");
printf("\n2.Admin usage\n");
scanf("%d",&choice);
system("cls");
}

else {

printf("\nWARNING YOUR SECRET NUMBER IS INCORRECT\n");


return 0;

if (choice ==1) {

printf("\n****************************************************************************
**********************************************************************\n");
Sleep(1000);
printf("\n

Lunch Menu\n ");

printf("\n****************************************************************************
************************************************************************\n");

printf("\n
Beverages..........................Pasteries............................Meals.......................Snacks
");
printf("\n1.Box drink
4.apple
");

2.Banna Bread

3.Small Lunch

printf("\n5.Ornge Juice
8.doritos

6.Cinimon Danish
");

7.Medium Lunch

printf("\n9.Small hawaiian punch


12.snackables

10.CHeese Bread
");

11.Large Lunch

printf(" \n13.Large hawaiian punch


14.sugarbun $100
15.sandwich biscuits ");
//lunch menu it self

else
{

printf("\nfor official use only\n");


printf(" \nEnter admin code\n");
scanf("%d",&admin);
if (admin==5){
printf("\ntotal orders for the day=%d\n",count);
printf("\ntotal profit for the day=$%d\n",total);
}

getch();

system("cls");
printf("\n\nThis option is used to sort and declare new items for
the menu if they are no items to be sorted type 0 \n\n");
printf("\nEnter number of elements\n");
scanf("%d", &x);

printf("Enter %d integers\n", x);

for (z = 0; z < x; z++)


scanf("%d", &array[z]);

for (z = 0 ; z < ( x - 1 ); z++)


{
for (w = 0 ; w < x - z - 1; w++)
{

if (array[w] > array[w+1]) /* For decreasing order use < */


{
swap

= array[w];

array[w] = array[w+1];
array[w+1] = swap;
}
}
}

printf("Sorted list in ascending order:\n");

for ( z = 0 ; z < x ; z++ )


printf("%d\n", array[z]);

getch();
system("cls");
main();

printf(" PLACE YOUR ORDER");

//_____________________ENGINE OF MY
PROGRAM_______________________________________________

system("color C7"); //screen color


printf("\n *** MAIN MENU OPTIONS *** \n");
printf("________________________________\n\n");
printf("1. Add item to order list\n");
printf("2. Remove item from order list\n");
printf("3. Exit \n\t");
printf("\n Please enter choice\n" );
scanf("%d",&c);
//___________________________________________________________________________________
_____________________accepts users choice

switch(c)
{
case 1: Enqueue(); // function that adds to queue
break;

case 2: Dequeue(); //function that removes items from queue


break;

default: printf("Incorrect Selection");


system("pause");
main();

return 0;
getch();

void Enqueue() //add a new item to queue


{

if(queue[5]!= 0)

{
printf("order list is FULL");
}

else
{

for(k=1; k<5; k++)


{

printf("\t\nEnter New item Number to order


list: ");
scanf("%d",&queue[k]);
//________________________________________________________adding to

Queue

printf("\nprice of that item have been


added \n");
printf("\n \n >>>Press any key to
contine<<< ");
getch();
b=b+1;

}
}

printf("\n**********************Lunch
Recipt************************\n");
printf("\t item numbers you have choosen = %d \n\n",b); // prints
total elements in b

for(k=1; k<5; k++)


{

printf(" _%d_ \t",queue[k]);

total=(100*4);
printf("\ntotal price = $400\n");
printf("\naccount balance =\n");
account=(account-total);
printf("%d\n",account);

count=count+1;
printf("\norder number= %d\n",count);

printf("\n \nReturning to MainMenu.\n \t Press any Key to continue...");


getch();

system("cls");

main();

}//______________________________________________________________________end
of function

void Dequeue() //to remove an item from the queue


{
printf("\nitem number you have choosen\n");
for(k=1; k<5; k++)
{
printf(" _%d_ \t",queue[k]);
}

getch();
system("cls");

if(p==0)
{

while (queue[5] == 0)
{
printf("\n\n ** order list is Empty **");
printf("\n \nReturning to
MainMenu.\n \t Press any Key to continue...");
getch();
system("cls");
main();
p=p++;
}

printf(" \n** Deleting........... ** \n\t >>>Press 'Enter' to continue");

system("cls");

if(e==0)
//_________________________________________________________________________________To
make the first 'n=1' posssible

{
n=1;
}

while(n!=0)
{

for(k=1; k<5; k++)


{
if(queue[n]!=0)
{
queue[n]=0;
//_______________________________________________________________removing from
queue
b=b-1;
}
}
n=n+1;
e=e+1;
break;
}

//______________________________________________________DISPLAY
SCREEN__________________________________________________________________________
printf("\n**********************Lunch
Recipt************************\n");

printf("\t First item in as been Deleting\n");


printf("\t---------------------------------");
printf("\n Currently in added:\n");
printf("\nyou have refunded one item the
money will return to your account\n");
account=(account+100);
total=(total-100);
printf("\naccount amount is now %d\n",account);
for(k=1; k<5; k++)
{
printf("\t%d\n\n",queue[k]);
}

printf("\n \nReturning to MainMenu.\n \t Press


any Key to continue...");
getch();
system("cls");
main();

getch();

};

Home screen of the electronic lunch system. This is where the user is ask to enter
his/her pin code to unlock that specific account. In this case the pin is 123 and there
is only one account on the system.

If for instance a student enters the wrong code the system print warning secret
number is incorrect and then it would go back to the home screen.

When the code is correct however the system would then display a menu of two
options. The student is authorized to select the first one only.

When a student selects the first option he/she is then presented with a new option
menu. At the top of this menu however the lunch menu is displayed. As you can see
there are numbers beside ever food item above. This is called the item number.

Up on adding selecting the first option, the student would then be ask to select the
item number with then would indicate the specific item. In this case the user
selected 4 items. The total price for the items are now then calculated, along with
the account balance, and the order number. This then is printed on the receipt.

For security purposes the system will then go back to the home screen, If the
student wishes to take off an item from his/her list.

To removes an item from the list the student would then have to select option 2. Up
on this selection the all the items that the student has previously selected would
then be displayed.

The user then would press enter to remove the item, however it would be the first
item that will be removed. A new receipt has now being printed and the refund
money would then be added to the account.

For security purposes the system would then go back to the home screen. Thus who
so ever wants to access it would then have to enter their secret number.

In the first options display, there is an option to for the administration. If the
administration wants to check the amount of money they made for the day and the
amount of order they had for day, they would just select this option enter their
admin code which is 5 to view this recording.

After that has being displayed the administrator would then face and other option.
This is to sort out any new item number that the company has received and want to
add to the lunch menu. The items in the lunch menu however is sorted in acceding
or hence they are numbered 123 and so on. It would be hard for the administration
to sort over a hundred items that would be added to the menu. This system
however does it for them.

After this is done for security purposes and company confidentiality the system
goes to the home screen.

Questionnaire
1. How old are you?
17-18

18-19

19-20

20-25

2. How you ever ordered food from the mothers canteen?


Yes

no

3. How long have you been ordering from the mothers canteen?
2 years

3 years

5 years

7 years

4. Do you like the services at mothers?


Yes

no

5. Do you prefer to carry your lunch from home or buy at the mothers canteen?
Buy from mother

carry your own lunch

6. What should mothers do think the mothers canteen should do to improve their
services?
Implement better tasting food

implement better customer service

Implement an electronic system that takes orders faster


7. Are frustrated with the long line in the mothers canteen?
Yes

no

8. If you had the chance to change the franchise at the canteen, to which franchise
would you change it to?
Burger king

tastes

KFC

juicy Beef

9. Are the prices of the food at the mothers canteen too expensive?
Yes

no

10. Does it take you a long time to get your lunch from the mothers canteen?
Yes

no

You might also like