Professional Documents
Culture Documents
Proposal letter
To,
The Managing Director,
Dherai-Mitho Khane Kura,
Baneshwor, Kathmandu, Nepal
Sir/madam,
With reference to the advertisement published in the date 4th June 2009 in the newspaper, I
would like to design a digital billing system for your restaurant. I have been designing
software for about two years and so I am quite experienced in this field and I am very
confident regarding developing a digital billing system for your restaurant.
As per your requirement published in the newspaper, my qualification and experience in
this field is sufficient to develop a simple console mode digital order system. If you would
like to learn more about my qualifications and experience, I have attached other
documents and certificate with this document.
It will be my pleasure to develop a program for your restaurant. I will be waiting for your
response.
Yours Sincerely,
Manisha Bhattarai
Acceptance letter
Date: 10th June 2009
To,
Miss Manisha Bhattarai,
Ward no. 10,
Baneshwor, Kathmandu, Nepal
Dear, manisha,
This letter has been written to you to inform you that you have been
selected to design a digital order system for our restaurant. I went through your proposal
letter and your qualifications and experience and i am sure that you will fit perfect for this
job.
I also went through your basic designing concept and to learn and discuss more about it I
would like to call you for a meeting on the 12th of July at our restaurant. To prove your
identity, you should also bring the photocopy of the papers you sent to our restaurant on
the 6th of July.
Me as well as other members of the restaurant will be very pleased to see you and work
with you.
Technical proposal
Acknowledgement
Creating this program was a very nice and useful experience for me as I not only built my
skills regarding programming but also got a chance to widen to knowledge in this field.
Building this project would be impossible without the help of our instructor Mr. Manoj
Manandhar. So, first of all I would like to give a heartfelt thank to him.
Without the help and co-operation of my friends, I would not have been able to solve my
problems related to programming in the absence of my instructor. So I would also thank
my friends for helping me in the time of need.
Last but not the least, the co-operation and help of the friendly staffs and the environment
provided by the Informatics College also helped me in building my project to this level.
So, thank you to the entire staffs and to the informatics college.
Introduction
I am about to develop a software for Dherai Mitho Khane Kura Restaurant. It is located at
Baneshwor, Kathmandu, Nepal was established about a year ago and has and has been
serving certain variety of food items to the customers visiting the restaurant since then.
Currently, the restaurant has seven employees at the restaurant which includes two cook,
manager, waiters and other employees. Currently this restaurant can serve about only 20
customers a day. The restaurant has been thinking about implementing some kind of new
technology within the organization that would help to improve the standard of the
organization as well as make it easy for the employees within the restaurant.
Dherai Mitho Khane Kura Restaurant currently has about seven employees including the
manager, waiters and so on. It has been only a year since the restaurant has been
established so the number of customers visiting the restaurant is in average rate. Currently,
the order from the customers is taken by getting one of the waiters into the customers
table. The customers can pay the bill to the restaurant after they consume the food and this
is in the form of a paper. The billing of the food consumed by the customers is maintained
in a paper.
Due to the above mentioned current system, various problems is being faced by the
restaurant. Even though the number of customers visiting the restaurant are in average
rate, due to the lack of waiters at the restaurant the customers sometimes do not get their
order at time. Other major problem the restaurant is facing is due to the billing method.
The record of the bills is maintained in the form of a paper which makes its very
vulnerable to loss and even getting torn out. Sometimes there has also been some kind of
mistake by the waiters due to which the customers were not satisfied by our service and
things like this give a very false impression to the customers. Other problems that the
restaurant is facing due to the current system is that Sometimes customers do not pay for
their food items so there is always insecurity regarding payment of the food consumed by
the customer. Along with all these problems, the restaurant also faces a lot of problem
when the data has to be retrieved from the old records which are very time consuming.
To reduce the problems being faced by the restaurant, I introduced software that performs
certain function that will help to eliminate the problems being faced by the restaurant. My
program will use an electronic device i.e. a computer instead of the traditional billing
system where papers were used to keep the record of the bills of the customers. In the
purposed system, the customers have to get to the computer where an employee is present
to get the order of the food and that is before having the food to reduce the insecurity
regarding payment of the food consumed by the customer. In the purposed system, the
records of the bills are maintained in a log file instead of the papers so that the risk of the
papers getting lost and torn out is reduced. The implementation of purposed system will
also help to make the order service more managed and quick.
1. To save the time of the customers as well as employees since the order is taken
directly from the computer by the customers.
2. To make it easier for the employees to use and maintain the record.
3. To ensure that the record of the food items consumed is maintained digitally with
the help of the log file.
4. To reduce the loss of bills that used to be stored in the form of paper previously.
Program Design
Flowchart
Press Enter
Error Message is
Display menu Displayed
Enter choice
Display
Availability
Is it
Is it
Is it an
Yes great Yes Yes
an empt
er
alph y
than
abet? input
13?
s?
No
No No
Press Enter
Display menu
Enter choice
Is it
Is it
Is it an
Yes great Yes Yes
an empt
er
alph y
than
abet? input
13?
s?
No
No No
Enter food
name
Is it
an
Error Message is empt Yes Error Message is
Displayed y Displayed
input
?
No
Is it
Is it Is it an
Yes a empt
great Yes Yes
char er y
acte than input
40? ?
r?
No No No
Cho
ice
to No
have
anyt
hing
else
Yes
Is it
an
empt Yes
Error Message is y Error Message is
Displayed Displayed
input
?
No
Is it
Is it Is it an
Yes a great Yes empt Yes
char er y Error Message is
acter than input Displayed
? 40? ?
No
No No
Enter name
Is it
an
empt Yes
y Error Message is
Displayed
input
?
No
Display bill
Enter food
name
Is it
Is it
an
great
empt
er
Submitted
y
than by: Manisha Bhattarai (1801T1090085)
input Error Message is
8
40?price
Enter food
? Displayed
C1054 Java Programming
No
Is it
Is it an
Yes an empt Yes Yes
alph y
abet? input
?
No No No
Is it
an
empt Yes
Error Message is y Error Message is
Displayed Displayed
input
?
No
Is it
an Is it Is it
Yes alph an Yes great Yes
abet empt er Error Message is
y than Displayed
?
input 40?
No
No No
Enter name
Is it
an
empt Yes
y Error Message is
Displayed
input
?
Data is appended to a
text file
Do
you
wish No
to
view
log
file?
Yes
Log file is
viewed
End
Type the number present on the right hand side of the food
Enter
Command Prompt– theorderServiceee
java food Price: 99 X
Menu
Submitted by: Manisha Bhattarai (1801T1090085)
8
C1054 Java Programming
Bill
----------------------------------------------------------------------
| THE THEVALUE
CHOICE
YOU ENTERED
YOU
YOU ENTERED
ENTERED
AN EMPTYISISNOT
INVALID!
VALUE
NUMERIC! |
| Submitted by: Manisha Bhattarai | (1801T1090085)
| TRY AGAIN! | 8
----------------------------------------------------------------------
C1054 Java Programming
LOG FILES
--------------
Bill
Bill
Program Listing
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.io.*;
import java.util.*;
try
{
while((s=dis.readLine())!=null)
{
list.add(s);
}
System.out.println("\r\n");
System.out.println("\t"+"\t"+"################################################
#");
System.out.println("\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#");
System.out.println("\t"+"\t"+"#"+"\t"+" Welcome to our Resturant!"+"\t"+"\t"+"#");
System.out.println("\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#");
System.out.println("\t"+"\t"+"################################################
#");
String checkOut=br.readLine();
System.out.println("\r\n");
System.out.println("\t"+"No."+"\t"+"Veg"+"\t"+"\t"+"Price"+"\t"+"No."+"\t"+"Non-
Veg"+"\t"+"\t"+"Price");
System.out.println("\t"+"-----------------------------"+"\t"+"-----------------------------");
System.out.println("\r\n"+"\r\n");
}
catch(Exception e)
{
e.printStackTrace();
}
System.out.println("\t"+"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx");
System.out.println("\t"+"x"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" x");
System.out.println("\t"+"x"+" Type the number present on the right hand side of the
food."+" x");
System.out.println("\t"+"x"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" x");
System.out.println("\t"+"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx");
System.out.println("\r\n");
}
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.io.*;
import java.util.*;
try
{
while(cc.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Re-enter your choce:");
cc=br.readLine();
}
int c=Integer.parseInt(cc);
if(c>12)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"THE CHOICE YOU ENTERED IS
INVALID!"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Re-enter your choce:");
cc=br.readLine();
c=Integer.parseInt(cc);
}
switch(c)
{
case 1:
{
System.out.println("\r\n");
System.out.println("\r\n"+"\t"+"\t"+"\t"+available);
System.out.println("\t"+"\t"+"\t"+underline);
System.out.println("\r\n");
}
break;
case 2:
{
System.out.println("\r\n");
System.out.println("\r\n"+"\t"+"\t"+"\t"+available);
System.out.println("\t"+"\t"+"\t"+underline);
System.out.println("\r\n");
}
break;
case 3:
{
System.out.println("\r\n");
System.out.println("\r\n"+"\t"+"\t"+"\t"+available);
System.out.println("\t"+"\t"+"\t"+underline);
System.out.println("\r\n");
}
break;
case 4:
{
System.out.println("\r\n");
System.out.println("\r\n"+"\t"+"\t"+"\t"+available);
System.out.println("\t"+"\t"+"\t"+underline);
System.out.println("\r\n");
}
break;
case 5:
{
System.out.println("\r\n");
System.out.println("\r\n"+"\t"+"\t"+"\t"+available);
System.out.println("\t"+"\t"+"\t"+underline);
System.out.println("\r\n");
}
break;
case 7:
{
System.out.println("\r\n");
System.out.println("\r\n"+"\t"+"\t"+"\t"+"Sorry this item is Unavailable");
System.out.println("\t"+"\t"+"\t"+underline);
System.out.println("\r\n");
getNumm();
}
break;
case 9:
{
System.out.println("\r\n");
System.out.println("\r\n"+"\t"+"\t"+"\t"+available);
System.out.println("\t"+"\t"+"\t"+underline);
System.out.println("\r\n");
}
break;
case 12:
{
System.out.println("\r\n");
System.out.println("\r\n"+"\t"+"\t"+"\t"+available);
System.out.println("\t"+"\t"+"\t"+underline);
System.out.println("\r\n");
}
break;
}
}
catch(Exception e)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
Import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.io.*;
import java.util.*;
try
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Enter the food name:"+" ");
String nameInput=br.readLine();
while(nameInput.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Re-Enter the food name:"+" ");
nameInput=br.readLine();
}
String nameInputt=nameInput.toUpperCase();
System.out.println("");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Enter the food Price:"+" ");
String priceInput=br.readLine();
while(priceInput.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Re-Enter the food Price:"+" ");
priceInput=br.readLine();
}
int priceInputt=Integer.parseInt(priceInput);
if(priceInputt>40)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"THE CHOICE YOU ENTERED IS
INVALID!"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Enter the food Price:"+" ");
priceInput=br.readLine();
priceInputt=Integer.parseInt(priceInput);
}
System.out.println("\r\n"+"\r\n");
List list =new ArrayList();
list.add(nameInputt);
list.add(priceInputt);
System.out.println("\t"+"\t"+"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x");
System.out.println("\t"+"\t"+"x"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"x");
System.out.println("\t"+"\t"+"x"+"\t"+"Do you wish to have anything else?"+"\t"+"x");
System.out.println("\t"+"\t"+"x"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"x");
System.out.println("\t"+"\t"+"x"+"\t"+"If yes press 1 otherwise press 0"+"\t"+"x");
System.out.println("\t"+"\t"+"x"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"x");
System.out.println("\t"+"\t"+"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x");
System.out.println("\r\n"+"\r\n");
return list;
}
catch(Exception e)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"THE VALUE YOU ENTERED IS NOT
NUMERIC!"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
return EnterName();
}
}
while(ii.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Please Re-enter the value:"+" ");
ii=br.readLine();
}
int ss=Integer.parseInt(ii);
if(ss>1)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"THE CHOICE YOU ENTERED IS
INVALID!"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Please Re=enter the value:"+" ");
ii=br.readLine();
ss=Integer.parseInt(ii);
}
return ss;
}
catch(Exception e)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"THE VALUE YOU ENTERED IS NOT
NUMERIC!"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
return Enter_choice();
}
}
switch(jj)
{
case 0:
{
System.out.println("\r\n"+"\r\n");
while(name_one.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\t"+"\t"+"\t"+"Please enter your name:"+" ");
name_one=br.readLine();
}
String name_two=name_one.toUpperCase();
System.out.print("\r\n"+"\r\n");
dos_two.writeBytes("\r\n"+"\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.writeBytes("\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.writeBytes("\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.writeBytes("\t"+"\t"+"#"+"\t"+"ENJOY YOUR FOOD
"+name_two+"!"+"\t"+"\t\t"+"#");
dos_two.writeBytes("\r\n"+"\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.writeBytes("\t"+"\t"+"###############################################
##");
dos_two.flush();
dos_two.close();
while((disp=dis_two.readLine())!=null)
{
System.out.println(disp);
}
System.out.println();
}
break;
case 1:
{
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Enter the food name:"+" ");
String nameInput_two=br.readLine();
while(nameInput_two.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Re-enter the food name:"+" ");
nameInput_two=br.readLine();
}
String nameInputtt=nameInput_two.toUpperCase();
System.out.println("");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Enter the food Price:"+" ");
String priceInput_two=br.readLine();
while(priceInput_two.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Enter the food Price:"+" ");
priceInput_two=br.readLine();
}
int priceInputtt=Integer.parseInt(priceInput_two);
if(priceInputtt>40)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"THE CHOICE YOU ENTERED IS
INVALID!"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Re-Enter the food Price:"+" ");
priceInput_two=br.readLine();
priceInputtt=Integer.parseInt(priceInput_two);
}
System.out.println("\r\n");
System.out.print("\t"+"\t"+"\t"+"Please enter your name:"+" ");
String name_one=br.readLine();
while(name_one.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\t"+"\t"+"\t"+"Please enter your name:"+" ");
name_one=br.readLine();
}
String name_two=name_one.toUpperCase();
System.out.print("\r\n"+"\r\n");
int priceInput_three=Integer.parseInt(neww1);
int priceInput_four=Integer.parseInt(priceInput_two);
int priceOutput=priceInput_three+priceInput_four;
dos_three.writeBytes("\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_three.writeBytes("\t"+"\t"+"#"+"\t"+"ENJOY YOUR FOOD
"+name_two+"!"+"\t"+"\t\t"+"#");
dos_three.writeBytes("\r\n"+"\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_three.writeBytes("\t"+"\t"+"##############################################
###");
dos_three.flush();
dos_three.close();
while((disp_1=dis_3.readLine())!=null)
{
System.out.println(disp_1);
}
}
break;
}
}
catch(Exception e)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"THE VALUE YOU ENTERED IS NOT
NUMERIC!"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
EnterNamee(neww,neww1,jj);
}
}
}
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.io.*;
import java.util.*;
while(nameInput.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Re-Enter the food name:"+" ");
nameInput=br.readLine();
String nameInputt=nameInput.toUpperCase();
System.out.println("");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Enter the food Price:"+" ");
String priceInput=br.readLine();
while(priceInput.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Enter the food Price:"+" ");
priceInput=br.readLine();
}
int priceInputt=Integer.parseInt(priceInput);
if(priceInputt>40)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"THE CHOICE YOU ENTERED IS
INVALID!"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Enter the food Price:"+" ");
priceInput=br.readLine();
priceInputt=Integer.parseInt(priceInput);
}
System.out.println("\r\n"+"\r\n");
List list =new ArrayList();
list.add(nameInputt);
list.add(priceInputt);
System.out.println("\t"+"\t"+"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x");
System.out.println("\t"+"\t"+"x"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"x");
System.out.println("\t"+"\t"+"x"+"\t"+"Do you wish to have anything else?"+"\t"+"x");
System.out.println("\t"+"\t"+"x"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"x");
System.out.println("\t"+"\t"+"x"+"\t"+"If yes press 1 otherwise press 0"+"\t"+"x");
System.out.println("\t"+"\t"+"x"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"x");
System.out.println("\t"+"\t"+"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x");
System.out.println("\r\n"+"\r\n");
return list;
}
catch(Exception e)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"THE VALUE YOU ENTERED IS NOT
NUMERIC!"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
return EnterNamem();
}
}
while(ii.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\t"+"\t"+"\t"+"Re-Enter your choice:"+" ");
ii=br.readLine();
}
int ss=Integer.parseInt(ii);
if(ss>1)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"THE CHOICE YOU ENTERED IS
INVALID!"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\r\n");
System.out.print("\t"+"\t"+"\t"+"Re-Enter your choice:"+" ");
ii=br.readLine();
ss=Integer.parseInt(ii);
}
return ss;
}
catch(Exception e)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"THE VALUE YOU ENTERED IS NOT
NUMERIC!"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
return get_choice();
}
switch(m)
{
case 0:
{
System.out.println("\r\n");
System.out.print("\t"+"\t"+"\t"+"Please enter your name:"+" ");
String name_one=br.readLine();
while(name_one.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\t"+"\t"+"\t"+"Please enter your name:"+" ");
name_one=br.readLine();
}
String name_two=name_one.toUpperCase();
System.out.print("\r\n");
dos_two.write("\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.write("\t"+"\t"+"#"+"\t"+"Food-Item"+"\t\t"+"Price-RS."+"\t"+"#");
dos_two.write("\r\n"+"\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.write("\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.write("\t"+"\t"+"#"+"\t"+neww+"\t\t\t"+neww1+"\t\t"+"#");
dos_two.write("\r\n"+"\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.write("\t"+"\t"+"#"+"\t"+"-----------------------------"+"\t"+"\t"+"#");
dos_two.write("\r\n"+"\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.write("\t"+"\t"+"#"+"\t"+"Total:"+"\t\t\t"+neww1+"\t\t"+"#");
dos_two.write("\r\n"+"\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n"dos_two.write(
"\t"+"\t"+"#"+"\t"+"-----------------------------"+"\t"+"\t"+"#");
dos_two.write("\r\n"+"\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.write("\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.write("\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.write("\t"+"\t"+"#"+"\t"+"ENJOY YOUR FOOD
"+name_two+"!"+"\t"+"\t\t"+"#");
dos_two.write("\r\n"+"\t"+"\t"+"#"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"#"+"\r\n");
dos_two.write("\t"+"\t"+"#################################################");
dos_two.close();
}
break;
case 1:
{
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Enter the food name:"+" ");
String nameInput_two=br.readLine();
while(nameInput_two.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Re-Enter the food name:"+" ");
nameInput_two=br.readLine();
}
String nameInputtt=nameInput_two.toUpperCase();
System.out.println("");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Enter the food Price:"+" ");
String priceInput_two=br.readLine();
while(priceInput_two.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Re-Enter the food Price:"+" ");
priceInput_two=br.readLine();
}
int priceInputtt=Integer.parseInt(priceInput_two);
if(priceInputtt>40)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"THE CHOICE YOU ENTERED IS
INVALID!"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"|");
System.out.println("\t"+"\t"+" -----------------------------------------------");
System.out.println("\r\n");
System.out.print("\r\n"+"\t"+"\t"+"\t"+"Re-Enter the food Price:"+" ");
priceInput_two=br.readLine();
priceInputtt=Integer.parseInt(priceInput_two);
}
System.out.println("\r\n");
System.out.print("\t"+"\t"+"\t"+"Please enter your name:"+" ");
String name_one=br.readLine();
while(name_one.trim().length()<=0)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+" YOU ENTERED AN EMPTY
VALUE!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
System.out.print("\t"+"\t"+"\t"+"Please re-enter your name:"+" ");
name_one=br.readLine();
}
String name_two=name_one.toUpperCase();
System.out.print("\r\n"+"\r\n");
int priceInput_three=Integer.parseInt(neww1);
int priceInput_four=Integer.parseInt(priceInput_two);
int priceOutput=priceInput_three+priceInput_four;
dos_three.close();
}
break;
}
}
catch (Exception e)
{
System.out.println("\r\n");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"THE VALUE YOU ENTERED IS NOT
NUMERIC!"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"TRY AGAIN!"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+"|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" |");
System.out.println("\t"+"\t"+" -------------------------------------------------");
System.out.println("\r\n");
EnterNameem(neww,neww1,m);
}
}
}
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.io.*;
import java.util.*;
public Read_txtFile()
{
try
{
System.out.println("\t"+"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx");
System.out.println("\t"+"x"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" x");
System.out.println("\t"+"x"+"\t"+" If you wish to view the log file press r"+"\t"+"\t"+"
x");
System.out.println("\t"+"x"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" x");
System.out.println("\t"+"x"+"\t"+"If you do not wish to view log file press
anything"+"\t"+" x");
System.out.println("\t"+"x"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+" x");
System.out.println("\t"+"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx");
if(choice_r.equals("r"))
{
choice=1;
}
switch(choice)
{
case 1:
{
InputStream is=new FileInputStream(file);
DataInputStream dis=new DataInputStream(is);
String line="";
List list=new ArrayList();
while((line=dis.readLine())!=null)
{
list.add(line);
}
System.out.println("\r\n");
System.out.println("\t"+"\t"+"\t"+"\t"+"LOG FILES");
System.out.println("\t"+"\t"+"\t"+"\t"+"----------");
for(int i=0;i<list.size();i++)
{
System.out.println(list.get(i));
}
}
default:
{
System.exit(0);
}
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
Program Testing
Test plan
is entered.
9. To examine whether food name accepts empty input or not
10. To examine whether food price accepts empty input or not
11. To examine whether food price accepts a character or not
12. To examine whether food price accepts number greater than 40 or not.
To 13.
examine To examine whether a box to order another food item appears or not.
14. To examine whether choice accepts empty input or not
15. To examine whether choice accepts a character or not
16. To examine whether choice accepts number greater than one or not
17. To examine whether name accepts empty input or not
To examine whether the food price, food name and customer’s name is written
on a file or not
19. To examine whether the bill is displayed or not
20. To examine whether data is appended on a file or not
21. To examine whether the program asks for the same data to be entered for the
log file or not
22. To examine whether a box that gives choice to view log file appears or not
23. To examine whether the log file is displayed or not when r is pressed
24. To examine whether the program exits or not from the system when choices
other than r is pressed
Test case: 1
To examine whether the program is compiled or not
Test Data: Javac orderservicee.java
Expected Test Result: The program should be compiled
Actual Test Result: The program is compiled
Conclusion: The command was executed without any error
Test case: 2
To examine whether the program runs or not
Test Data: Java orderservicee.java
Expected Test Result: Program must display welcome message
Actual Test Result: Program displayed welcome message
Conclusion: The command was executed without any error
Test case: 3
To examine whether the program displays the menu when enter is
pressed
Test Data: “enter”
Expected Test Result: Menu should be displayed
Actual Test Result: Menu was displayed
Conclusion: The command was executed without any error
Test case: 4
Objective: To examine the box displaying the food choice information
appears or not.
Test Data: “blank”
Expected Test Result: A message box must appear
Actual Test Result: A message box appears
Conclusion: The command was executed without any error
Test case: 5
Objective: To examine whether food choice accepts empty input or not
Test Data: “enter”
Expected Test Result: Error message should appear
Actual Test Result: Error message appeared
Conclusion: The command was executed without any error
Test case: 6
Objective: To examine whether food choice accepts a character or not
Test Data: A
Expected Test Error message should appear
Result:
Actual Test Result: Error message appeared
Conclusion: The command was executed without any error
Test case: 7
To examine whether food choice accepts number greater than 12
or not
Test Data: 13
Expected Test Result: Error message should appear
Actual Test Result: Error message appeared
Conclusion: The command was executed without any error
Test case: 8
Objective: To examine whether the availability of food is displayed or not
after the choice is entered.
Test Data: “enter”
Expected Test Result: A message saying “Available” or “Unavailable” should appear
Actual Test Result: Error message appeared
Test case: 9
Objective: To examine whether food name accepts empty input or not
Test Data: “enter”
Expected Test Result: Error message should appear
Actual Test Result: Error message appeared
Test case: 10
Objective: To examine whether food price accepts empty input or not
Test Data: “enter”
Expected Test Result: Error message should appear
Actual Test Result: Error message appeared
Conclusion: The command was executed without any error
Test case: 11
Objective: To examine whether food price accepts a character or not
Test Data: B
Expected Test Result: Error message should appear
Actual Test Result: Error message appeared
Conclusion: The command was executed without any error
Test case: 12
To examine whether food price accepts number greater than 40 or
not.
Test Data: 42
Expected Test Result: Error message should appear
Actual Test Result: Error message appeared
Conclusion: The command was executed without any error
Test case: 13
Objective: To examine whether a box to order another food item appears or
not.
Test Data: “blank”
Expected Test Result: Box with a message should appear
Actual Test Result: Box with a message appears
Test case: 14
Objective: To examine whether choice accepts empty input or not
Test Data: “enter”
Expected Test Result: Error message should appear
Actual Test Result: Error message appeared
Conclusion: The command was executed without any error
Test case: 15
Objective: To examine whether choice accepts a character or not
Test Data: C
Expected Test Result: Error message should appear
Actual Test Result: Error message appeared
Test case: 16
Objective: To examine whether choice accepts number greater than one or
not
Test Data: 3
Expected Test Result: Error message should appear
Actual Test Result: Error message appeared
Conclusion: The command was executed without any error
Test case: 17
Objective: To examine whether name accepts empty input or not
Test Data: “enter”
Expected Test Result: Error message should appear
Actual Test Result: Error message appeared
Conclusion: The command was executed without any error
Test case: 18
Objective: To examine whether the food price, food name and customer’s
name is written on a txt file or not
Test case: 19
Objective: To examine whether the bill is displayed or not
Test Data: “enter”
Expected Test Result: Bill should be displayed
Actual Test Result: Bill displayed
Conclusion: The command was executed without any error
Test case: 20
Objective: To examine whether data is appended on a txt file or not
Test Data: “blank”
Expected Test Result: Data should append on a file
Actual Test Result: Data was appended on a file
Conclusion: The command was executed without any error
Test case: 21
Objective: To examine whether the program asks for the same data to be
entered for the log file or not
Test Data: “blank”
Expected Test Result: A box with a message should appear
Test case: 22
Objective: To examine whether a box that gives choice to view log file
appears or not
Test Data: “blank”
Expected Test Result: A box with a message should appear
Test case: 23
Objective: To examine whether the log file is displayed or not when r is
pressed
Test Data: R
Expected Test Result: Log file must display
Actual Test Result: Log file was displayed
Conclusion: The command was executed without any error
Test case: 24
Objective: To examine whether the program exits or not from the system
when choices other than r is pressed
Test Data: “enter”
Test log
8. Successful
9. Successful
10. Successful
11. Successful
12. Successful
13. Successful
14. Successful
15. Successful
16. Successful
17. Successful
18. Successful
19. Successful
20. Successful
21. Successful
22. Successful
23. Successful
24. Successful
System requirement
Software requirement
Notepad
Hardware requirement
Pentium - 2 plus
User manual
Users should follow following steps to run my program:
Step 1
Go to the command prompt and make sure the path to the java/jdk/bin is set.
Step 2
Type the name of the file i.e. java orderServicee and press enter
Step 3
Step 4
Enter any one of the choice i.e. a number mentioned on the left hand side of the food item
of the menu.
Step 5
After the availability message is displayed, enter the name of the food
Step 6
Step 7
Now if you wish to order another food item enter 1 otherwise press 0.
Step 8
Step 9
Step 10
Step 11
Finally the bill of the customer will be displayed that will be printed with the help of a
printer.
Step 13
Now to keep the data on the log file again enter the name of the food item.
Step 12
Step 13
Now if you wish to order another food item enter 1 otherwise press 0.
Step 14
Step 15
Step 16
Step 17
Now if you wish to view log file press r otherwise press any key.
Step 18
If you press r the log file will be displayed and finally the program will terminate.
Conclusion
This program is mainly developed to implement new billing system at the restaurant for
the easiness of both employees of the restaurant and the customers as well. The project is
now complete and soon the restaurant will implement it in their restaurant.
Building this project not only helped me in polishing my skills regarding programming but
also helped me to broaden my knowledge in this field.
Program Strength
1. The program is not time consuming which helps to save the time of both
employees as well as the customers.
2. The log file of the bills maintained by this program makes the records less
vulnerable to loss and damages in comparison to papers.
3. The employee can insert and can view the records of the bills easily.
Program Weakness
1. This program can only run in console mode which is not quite used in today’s
context.
3. The data and time cannot be mentioned in the program. So, it is difficult to
determine at what time and which date the customers consumed the food.
Program Enhancements
1. The program will be made more attractive and one that will support GUI.
2. The program will be coded in such a way that more number of food items can
be ordered.
3. Date and time will be inserted in the program so that it can be inserted in the
record.
4. In addition to appending and retrieving option that already exists in the program,
a delete option will be added so that unnecessary or incorrect data can be
deleted from the record.
References