Disclaimer: This essay is provided as an example of work produced by students studying towards a computer science degree, it is not illustrative of the work produced by our in-house experts. Click here for sample essays written by our professional writers.

Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of UKEssays.com.

Puff And Fresh Restaurant Billing System Computer Science Essay

Paper Type: Free Essay Subject: Computer Science
Wordcount: 4686 words Published: 1st Jan 2015

Reference this

Puff and Fresh is a popular Restaurant where a large number of Customers Visited. It is very important to have a successful Billing system for the Restaurant. Currently the Restaurant has manual billing system which has many faults when maintain the Bills. Therefore it is good to maintain a computerize system to reduce the errors and to reduce the tiresome Billing system.

This documentation contains information on how the Billing system has been created. Facts are discussed under the following topics:

The documentation has clearly defined the above topics and there importance of the system. All requirements have been reasoned out and proper conclusions have been made.

1. Introduction

Puff and Fresh is a Restaurant. At present Puff and Fresh maintain manual Billing system and they need a computerize approach to maintain Bills. Puff and Fresh shows the customer the different breakfast items offered by the restaurant. Allow the customer to select more than one item from the menu. Calculate and Print the bill….

Get Help With Your Essay

If you need assistance with writing your essay, our professional essay writing service is here to help!
Find out more about our Essay Writing Service

It is required to develop a C++ application that could Print Menu Item, Price, Amount etc……The program is needed to have a user interface which contains the functionalities such as inserting number of adults and children. Choosing the menu and ordering the menu. Creating the bill and print the bill.

The aim of this assignment is to present the knowledge the students have gathered this module; 'C ++ programming'. The assignment is divided into their respective sections, and each section has its own objectives, which are to be achieved successfully.

Basic fact finding techniques have been followed and the preliminary investigation has been conducted to find out the problems faced by Puff and Fresh Restaurant. The current manual billing system consists of errors mentioned below.

Puff and fresh has daily customers. The Bills are stored in files and when the administration needs to access a particular bill, they have to manually go through the files and find it. This is often time consuming and can be a tiresome task.

Maintaining records in files over account details require a lot of space and those records may be damaged or misused due to the poor security measures the Restaurant has taken.

Since there are a lot of files to be handled, Puff and fresh has needed to handle accounts information's. This is an additional cost. And also the puff and fresh has to spend on paper and other stationary that are needed to store the billing system.

A full feasibility study has been conducted and its results show that a computerized system for Puff and fresh is economically, legally and technically feasible to implement.

3. Solution for the problem.

The preliminary investigation has given a clear idea about the problem the Puff and Fresh is currently facing. It is clear that the Restaurant needs a computerized system to run and manage the Bill process.

Prototyping life cycle model been chosen as the appropriate life cycle model to be used to implement the system. Results from the E-R diagrams and the data flow diagrams have given an idea about the entities and their relationships.

The new computerized system has been designed and created in a manner to solve all the problems the Restaurant is currently facing.

Entering no of adults: The computerized system is created to identify the amount of adults. This reduces the work of the staff by preventing manual entry of the number and so it prevents errors.

Entering no of children's: The computerized system is created to identify the amount of children's. This reduces the work of the staff by preventing manual entry of the number and so it prevents errors.

Requesting orders: this program can identify the request orders without any errors.

The system is password protected and the users have to enter a password to log into the system. This prevents unauthorized users logging into the system.

4. Flowcharts and pseudo codes for the system.

4.1Request Password function

Pseudo code

Request Password ()

Char password

Char enter Password

Open file "password"

Read from file password

Struct

Print "user id"

Print "password"

Get input enter id

Get input enter password

If enter id and password = id and password is true then

Print "user authenticated press enter to login the program"

Else

Print "no such login information you entered user id of password invalid please try again…"

End if

Close file

While

Enter user id and password! = administrator, password

End while

Return

4.2 Printing main menu

Pseudo code

Meals ()

Print "welcome to puff and fresh breakfast billing system"

Print "item no" "menu item" "price"

Print "1 string hoppers Rs65.00"

Print "2 egg sandwich Rs15.00"

Print "3 thosai with chutney Rs18.50"

Print "4 parata Rs10.50"

Print "5 sausage bun Rs30.00"

Print "6 fish roll Rs25.00"

Print "7 plain tea Rs10.00"

Print "8 coffee Rs15.00"

Print "9 tea Rs20.00"

Print "10 fruit juice Rs22.50"

End

4.3 Main menu

Pseudo code

Meals ()

Print "welcome to puff and fresh breakfast billing system"

Print "item no" "menu item" "price"

Print "1 string hoppers Rs65.00"

Print "2 egg sandwich Rs15.00"

Print "3 thosai with chutney Rs18.50"

Print "4 parata Rs10.50"

Print "5 sausage bun Rs30.00"

Print "6 fish roll Rs25.00"

Print "7 plain tea Rs10.00"

Print "8 coffee Rs15.00"

Print "9 tea Rs20.00"

Print "10 fruit juice Rs22.50"

Do while

Print "enter number of adults"

Get input number of adults

Print "enter number of children"

Get input number of children

Do while

Print "adult"

Print "please enter your orders"

Get input menu number <10

Print "please enter amount of order"

Get input amount order

Print" would you like to enter more orders (Y/N)"

Get input y or n

If

Input y

Print "please enter your orders"

Else

Print "children"

Print "please enter your orders"

Get input menu number <10

Print "please enter amount of order"

Get input amount order

Print" would you like to enter more orders (Y/N)"

Get input y or n

If input y print "please enter your orders"

Else

Print "puff and fresh billing system"

Print "adults/children amount total"

Print "would you like to continue (y/n)? "

If

Input get y

Return

Main menu

Else

Exit

5. Header files used in the program.

#include//for input and output library

#include// for string data types

#include//for search and sorting (standerd library)

#include//for mathematics

#include// for string data types

#include// for header files console input/outputs

5.1 User defined functions used in the the program

double price[10] = {65.00 , 15.00 , 18.50 , 10.50 , 30.00 , 25.00 , 10.00 , 15.00 , 20.00 , 22.50 }; //prices of the items

double mealTaxPrices[10]; // prices of the tax prices of the meals

int adultNumber,childNumber;// number of adults and childern

void printMeals();// fuction to print the meals

void orderMeals();// function to order the meals

double orderForAdult();// function to order for adults

double orderForChildren();// function to order for childern

void get_password();// function to get the password

static struct account accounts[] = { //user names and passwords of the program

void get_password ( char *pwd, int size )//function to get the paswwords

int main ()//fucntion to main

6. Coding of the Puff and fresh Billing System

// +++++++++++++ Puff and Fresh billing System ++++++++++++

#include//for input and output library

#include// for string data types

#include//for search and sorting (standerd library)

#include//for mathematics

#include// for string data types

#include// for header files console input/outputs

// Declaring Functions

double price[10] = {65.00 , 15.00 , 18.50 , 10.50 , 30.00 , 25.00 , 10.00 , 15.00 , 20.00 , 22.50 }; //prices of the items

double mealTaxPrices[10]; // prices of the tax prices of the meals

int adultNumber,childNumber;// number of adults and childern

void printMeals();// fuction to print the meals

void orderMeals();// function to order the meals

double orderForAdult();// function to order for adults

double orderForChildren();// function to order for childern

void get_password();// function to get the password

//arrays for the password

#define FIELD_SIZE 25

#define length(array) ( sizeof (array) / sizeof (array)[i] )

struct account {

char *id;

char *password;

};

static struct account accounts[] = { //user names and passwords of the program

{ "Administrator", "password" },

{ "Tuwan", "icbt" }

};

int is_authorized ( const char *uid, const char *pwd )//password is correct

{

int i;

for ( i = 0; i < length ( accounts ); i++ ) {

if ( stricmp ( uid, accounts[i].id ) == 0 &&

strcmp ( pwd, accounts[i].password ) ==0 )

{

return 1;

}

}

return 0;

}

void get_password ( char *pwd, int size )//function to get the paswwords

{

int i = 0;

int ch;

while ( i < size - 1 && ( ch = getch() ) != 'r' ) {

if ( ch == 'b' ) {

if ( i != 0 ) {

printf ( "b%cb", ' ' );

--i;

}

}

else {

putchar ( '*' );

pwd[i++] = (char)ch;

}

}

pwd[i] = '';

}

int main ()//fucntion to main

{

system ("cls");//to clear the screen

system ("color 0c");//This function help to change color in command prompt

char uid[FIELD_SIZE];

char pwd[FIELD_SIZE];

//print the Login

printf("t ----------------------------------------------------------n");//print this line

printf("t ********** Welcome to Puff and Fresh Restaurant **********n");//print this line

printf("t ----------------------------------------------------------nnnn");//print this line

printf("Login by keying in your details below :-nn");//print this line

printf ( "User ID: " );//print this line

fflush ( stdout );

if ( fgets ( uid, sizeof uid, stdin ) != NULL ) {

char *newline = strchr ( uid, 'n' );

if ( newline != NULL )

*newline = '';

printf ( "Password: " );//print this line

fflush ( stdout );

get_password ( pwd, sizeof pwd );

if ( is_authorized ( uid, pwd ) )

//If entered the correct data then this meseage will display.

printf("nnt <>n");

else

{

//If entered wrong then this error meseage will display and exit.

printf("nnttt<>");

printf("nnt<>n");

system("pause");

return main ();

}

}

getchar();

printMeals();

char response = 'y';

//print this in the main menu asking number of adults and number of chilrdren

printMeals();

while(response == 'y'|| response == 'Y')

{

printf("<*> please enter number of adults :");//print this line

scanf("%d",&adultNumber);

printf("<*> please enter number of children:");//print this line

scanf("%d",&childNumber);

orderMeals();

printf("n<*> would you like to continue(y/n):");//print this line

scanf("n%c",&response);

}

//in the bill this will print

printf("n ******************** THANK YOU FOR COMING ************************n");//print this line

printf(" 20********************** PLEASE VISIT US NEXT TIME **************************20 n");//print this line

system("pause");

return 0;

}

void printMeals()//fuction to print meals

{

char code;

system("cls");//to clear the screen

system ("color f3");//This function help to change color in command prompt

printf(" Puff and fresh Copyright: (C)2010 Tuwan.nn"); //print this line

printf(" 20=======================================================================20n"); //print this line

printf(" 20********************* WELCOME TO PUFF AND FRESH ***********************20n"); //print this line

printf(" 20********************* Breakfast Billing System ***********************20n"); //print this line

printf(" 20=======================================================================20nnn"); //print this line

printf(" tt Below is the menue:20nn"); //print this line

printf(" tt Item NotMenu ItemttPrice:n"); //print this line

printf(" tt 22*******************************22nn"); //print this line

printf(" tt 1- tString HoppersttRs.65.50n"); //print this line

printf(" tt 2-ttEgg SandwitchttRs.15.00n"); //print this line

printf(" tt 3- tThosai with ChutneytRs.18.50n"); //print this line

printf(" tt 4- tParatatttRs.10.50n"); //print this line

printf(" tt 5- tSausages BunttRs.30.00n"); //print this line

printf(" tt 6- tFish RollttRs.25.00n"); //print this line

printf(" tt 7- tPlain TeattRs.10.00n"); //print this line

printf(" tt 8- tCoffeetttRs.15.00n"); //print this line

printf(" tt 9- tTeatttRs.20.00n");//print this line

printf(" tt 10- tFruit JuicettRs.22.50n");//print this line

printf("n");

}

void orderMeals() //function to print order meals

{

double totalPriceForAdult, totalPriceForChildren;

double allPayment,discount;

printf(" tt**** ORDER MENUE****n"); //print this line

totalPriceForAdult = orderForAdult();

totalPriceForChildren = orderForChildren();

allPayment = totalPriceForAdult + totalPriceForChildren ;

system("cls");//to clear the screen

system ("color f4");//This function help to change color in command prompt

printf("t 20==================================================20");//print this line

printf("n tt 22****** WELCOME TO PUFF AND FRESH ******22 n");//print this line

printf(" tt*********** Breakfast Billing System ************ n");//print this line

printf(" t 20=============================================================20nn");//print this line

printf(" ttAdult/ChildttAmountttTotal Pricen");//print this line

printf(" ttadultsttt%dtt%5.2fn",adultNumber,totalPriceForAdult);//print adult amount and the price of the adult

printf(" ttchildrentt%dtt%5.2fn",childNumber,totalPriceForChildren);//print child amount and the price of the child

printf(" ttTotal billtttt%5.2fn",allPayment );//print the toal bill

//arithmetic of the bill

if(allPayment < 10)

discount=((allPayment * 0.5)/100);

else if(allPayment>= 10 && allPayment<20)

discount=((allPayment * 1)/100);

else if(allPayment>= 20 && allPayment<30)

discount=((allPayment * 1.5)/100);

else if(allPayment>= 30 && allPayment<40)

discount=((allPayment * 2.0)/100);

else

discount= ((allPayment * 5.0)/100);

printf(" ttTotal bill after discounttt%5.2fnn",allPayment-discount);//print total bill anfter discount

printf(" t No 234, peradeniya road, Kandy. Tel:- 081-2345678nn");//print this line

}

double orderForAdult() //fuction to print orders for adult

{

int menuOption,i,amount;

char response = 'y';

double totalPerPerson = 0.0,totalAllPerson = 0.0;

double tax = 5.0;

if(adultNumber <=0)

printf("n ");

else

printf("*tadults:n");//print this line

for(i=0;i{

printf("<$> adult %d please enter your ordersn",i+1);//print this line

while(response == 'y' || response == 'Y')

{

printf("<$> please enter your option:");//print this line

scanf("%d",&menuOption);

if(menuOption<1 || menuOption>10)

{

printf(" sorry we don`t have this order nagain! ");//print this line

continue;

}

printf("<$> please enter your amount of order:");//print this line

scanf("%d",&amount);

totalPerPerson = totalPerPerson + (amount * price[menuOption - 1] );//total price of a person

printf("<$> Would you like to enter more orders(y/n):");//print this line

scanf("n%c",&response);

}

printf("n");

totalAllPerson += totalAllPerson + totalPerPerson;//arithmetic

totalPerPerson = 0.0;

response = 'y';

}

return totalAllPerson + ((totalAllPerson * tax) / 100);//arithmetic

}

double orderForChildren()//fuction to print orders for child

{

int menuOption,i,amount;

char response = 'y';

double totalPerChild = 0.0,totalAllChildren = 0.0;

double tax = 5.0,oneOrder;

if(childNumber <=0)

printf("n");

else

printf("*tChildren:n");//print this line

for(i=0;i{

printf("<$> child %d please enter your ordersn",i+1);//print this line

while(response == 'y' || response == 'Y')

{

printf("<$> please enter your option:");//print this line

scanf("%d",&menuOption);

if(menuOption<1 || menuOption>10)

{

printf(" sorry we don`t have this order nagain! ");//print this line

continue;

}

printf("<$> please enter your amount of order:");//print this line

scanf("%d",&amount);

oneOrder = (price[menuOption - 1] * 60)/100 ;//this one order for a child with discount %60 of one order of adult

totalPerChild = totalPerChild + (amount * oneOrder) ;//total price of a person

printf("<$> Would you like to enter more orders(y/n):");//print this line

scanf("n%c",&response);

}

totalAllChildren += totalAllChildren + totalPerChild;

response = 'y';

totalPerChild = 0.0;

printf("n");

}

return totalAllChildren + ((totalAllChildren * tax) / 100);//arithmetic

}

//***************************************END*****************************************//

7. Advantages and Disadvantages of Puff and Fresh billing system:

Advantages of Puff and Fresh billing system

It is a Windows based system

The program is easy to learn.

Developing or modifying code is much easier and faster

Restricted to a limited number of users

You can have a fully functional and the user interface elements are quite powerful.

Improved security

Disadvantages of Puff and Fresh billing system

Take time to implement

Difficult to use in non-Windows environments.

Viruses can infect.

8. Data dictionary

Variable name

Data type

Description

account

struct

The struct assigned to the accounts

User id

char

Variable to hold the password

password

char

The variable holding the value for the confirm password

No of adults

Char

The variable holding the value for the confirm number of adults

No of children

char

The variable holding the value for the confirm number of children

payment

double

The variable holding the value of payment

total

double

The variable holding the value of total

discount

double

The variable holding the value of discount

tax

double

The variable holding the value of tax

Menu option

Int

The variable holding the value of menu option

Meals

char

The variable holding the value for the confirm meals

9. Test cases of the system.

Checking the User ID and Password

#

Test

Test Type

Expected Outcome

Actual

Outcome

1.1

Type in an incorrect User ID

Erroneous

Error message displayed

Error message displayed

1.2

Type in the correct Password.

Erroneous

Error message displayed

Error message displayed

1.3

Type in an correct

User ID

Erroneous

Error message displayed

Error message displayed

1.4

Type in an incorrect Password

Erroneous

Error message displayed

Error message displayed

1.5

Type in an correct

User ID

Normal

Logging into the system message displayed

Logging into the system message displayed

1.6

Type in an correct Password

Normal

Logging into the system message displayed

Logging into the system message displayed

Selecting options from the Main Menu ( Entering options using main menu Adult and children)

Adult

#

Test

Test Type

Expected Outcome

Actual

Outcome

2.1

Type in an incorrect option.

Erroneous

Error message displayed

Error message displayed

2.2

Type in the correct option

Normal

Option becomes available.

Option becomes available.

Selecting options from the Main Menu ( Entering options using main menu Adult and children)

Children

#

Test

Test Type

Expected Outcome

Actual

Outcome

2.1

Type in an incorrect option.

Erroneous

Error message displayed

Error message displayed

2.2

Type in the correct option

Normal

Option becomes available.

Option becomes available.

10. Report about the program

When chording this program Puff and Fresh Billing system I had to face lots of difficulties like syntax errors, semantic errors and compiling errors. Such as when we misspelled a word it becomes a syntax error. For example u can see below screenshot.

If there is an error in logic it becomes a logical error. When we compile the chord the compiling chord show the error. You can see an example below.

(A logical error)

11. Recommendations

Implementing a security system to allow access to only authorized personals.

Take regular backups of all the player records.

Conducting a user training and support plan to train the staff at Puff and Fresh.

Update the system in the future adding new features.

Implement a system where the player can order Items online.

Create a centralized database; thereby the same data is accessible from any location.

Security from viruses; computer viruses could be a major problem; therefore reliable antivirus software could be installed. This software could be updated on a regular basis and the employees should be trained to use it.

Keep the passwords updated; that is the users should change their passwords on a regular basis.

Install Malware and spyware guards to protect the system from being hacked.

12. Conclusion

The documentation includes all necessary information on the structure and the coding of the program created for Puff and Fresh Billing system. Creating the program was an overwhelming task that required a lot of analyzing, research work and personal skills. Below is a list of problems that had to be faced while creating the program.

Understanding the problem and coming up with the most suitable solutions.

Using the correct logics and the coding that would work best according to the requirements.

Making proper use of the data types and variables such as structs and arrays.

Understanding the errors that occur when using such data types and finding solutions to overcome those errors.

Creating user-defined functions and passing parameters successfully.

Creating proper user interface.

Creating proper messages for input and output.

Understanding the situations where displaying of error messages are needed and successfully creating them.

Above problems have been successfully analyzed and correct solutions have been given in this assignment.

Creating this report had been a great experience and a lot of facts have been learned since the required tasks have been given in a challenging manner. Tasks such as creating a system to a restaurant, needed research work as well as personal skills. Creating proper error messages was a very tiring task that consumed a lot of time. The program has been created successfully with proper error messages displaying at proper situations.

Alternative measures had to be taken when using arrays and enumerators to prevent run-time errors. Even though there were no logical or syntax errors, using arrays inside struct created errors with the memory and finding out those errors was a difficult task.

13. Gantt chart

14. Reference

Malik, D.S, I. (1999). C++ Programming: programmed Design Including Data Structures. Second Edition, Thompson Course technology, pp.269-294.

DaniWeb.LLC, 2003 - 2010, Viewed on 25th of August 2008, http://www.daniweb.com/forums/thread141983.html

Experts Exchange LLC 2009, viewed on 18th of August 2010, http://www.expertsexchange.com/Programming/Languages/CPP/Q_2163.html

About, Inc. About and About.com,2010, viewed on 24th of August 2010,

http://en.allexperts.com/q/C-1040/Storing-Info-Files.htm

Lectures tutes and notes of c++.

Exhedra Solutions, Inc, 1997-2010, viewed on 24th of August 2010, http://www.planetsourcecode.com/vb/default.asp?lngWId=3

Experts Exchange LLC 2010, viewed on 15th of August 2010, http://www.expertsexchange.com/Programming/Languages/CPP/Q_2163.html

 

Cite This Work

To export a reference to this article please select a referencing stye below:

Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.

Related Services

View all

DMCA / Removal Request

If you are the original writer of this essay and no longer wish to have your work published on UKEssays.com then please:

Related Services

Our academic writing and marking services can help you!

Prices from

£124

Approximate costs for:

  • Undergraduate 2:2
  • 1000 words
  • 7 day delivery

Order an Essay

Related Lectures

Study for free with our range of university lecture notes!

Academic Knowledge Logo

Freelance Writing Jobs

Looking for a flexible role?
Do you have a 2:1 degree or higher?

Apply Today!