Report CSC 186 PDF
Report CSC 186 PDF
TITLE
RESTAURANT BILLING SYSTEM
GROUP : A4CS1102A
TABLE OF CONTENT
1. EXECUTIVE SUMMARY 1
3. PROGRAM 4
5. SCORING RUBRICS 6
EXECUTIVE SUMMARY
Restaurant Billing System (RBS) is a new technology for taking orders from
customers. All information about the customer's order will be taken by the waiter
or waitress by using our billing system. Then the order will be retrieved by the
cashier and chef. Then it will calculate the total prices of the order that needs to
pay by customers. It also will produce the receipt to allow the waiter or waitress
to give it to customers as their references. The waiter or waitress need to printout
the receipt after customer pays their bill. The management of the restaurant can
be improved when using this system compared to the traditional method. The aim
of this program is to create a restaurant billing system that allows adding orders,
collect payments, finding out the total bill cost, adjust customers’ balances,
generate bill and display the bill of the customer.
• To develop a restaurant billing system that can add customers’ orders efficiently.
• To develop a restaurant billing system that can collect payments from the
customer more precisely.
• To develop a restaurant billing system that can calculate the total bill cost more
accurately.
• To develop a restaurant billing system that can adjust customers’ balances
effectively.
• To develop a restaurant billing system that can generate the bill more perfectly.
• To develop a billing system that enables customer to view bill information.
1
UML DIAGRAM
CLASS DIAGRAM
2
USE CASE
3
PROGRAM
• Main
import javax.swing.JOptionPane;
import java.io.*;
import java.util.Scanner;
public class main
{
public static void main (String [] args) throws IOException
{
l.accReader();
JOptionPane.showMessageDialog(null, "Acc Status: "+l.accRead);
int password;
do
{
String input1 = JOptionPane.showInputDialog("Enter Worker password : ");
password = Integer.parseInt(input1);
l.accReader(password);
}while(password != 123456);
o.OrderType();
System.exit(0);
}
}
4
• Login
import javax.swing.JOptionPane;
if (p == pinNum) {
JOptionPane.showMessageDialog(null, "Loading...");
return;
}
else {
JOptionPane.showMessageDialog(null, "Incorrect password. Try Again.");
}
}
}
5
• Customer
public class customer extends PolyCustomer
{
6
public int code2()
{
super.getCode2();
return getCode2();
}
public int quantity2()
{
super.getQuantity2();
return getQuantity2();
}
}
7
• PolyCustomer
public abstract class PolyCustomer
{
public String name;
public int tableNum;
public int pinNum;
char code1;
int quantity1;
int code2;
int quantity2;
double calcTotalPrice;
//default constructor
public PolyCustomer()
{
name = "Ikhmal";
tableNum = 5;
}
//normal constructor
public PolyCustomer(String n, int t, char c1, int q1, int c2, int q2, double ctp)
{
name = n;
tableNum = t;
code1 = c1;
quantity1 = q1;
code2 = c2;
quantity2 = q2;
calcTotalPrice=ctp;
}
// 2nd normal constructor
8
public PolyCustomer(int p)
{
pinNum = p;
}
// mutator methods
public void setName(String n)
{
name = n;
}
public void setTableName(int t)
{
tableNum = t;
}
public void setPinNumber(int p)
{
pinNum = p;
}
9
public void setQuantity2(int q2)
{
quantity2= q2;
}
// accessor methods
public String getName()
{
return name;
}
public int getTableNum()
{
return tableNum;
}
public int getPinNumber()
{
return pinNum;
}
public char getCode1()
{
return code1;
}
public int getQuantity1()
{
return quantity1;
}
public int getCode2()
{
return code2;
}
10
public int getQuantity2()
{
return quantity2;
}
11
• Order
import java.io.IOException;
import javax.swing.JOptionPane;
int option = 0;
option = Integer.parseInt(input);
12
String input3 = JOptionPane.showInputDialog("Drink order ,1 ,2 or 3 :");
int code2 = Integer.parseInt(input3);
String input4 = JOptionPane.showInputDialog("Drink Order Quantity :");
int quantity2 = Integer.parseInt(input4);
ct.calculateTotal(code1, quantity1, code2, quantity2);
}
else if(option ==2)
{
JOptionPane.showMessageDialog(null, "Thank you");
System.exit(0);
}
input = JOptionPane.showInputDialog("\nOrder Type :" +"\n 1. Dine Here \n 2. Log
Out\n");
option = 0;
option = Integer.parseInt(input);
}
}
}
13
• DineHere
import javax.swing.JOptionPane;
public class DineHere extends PolyCustomer
{
char code1;
int quantity1;
int code2;
int quantity2;
double calcTotalPrice;
public DineHere()
{
super();
}
public DineHere(char c1, int q1, int c2, int q2, double ctp)
{
code1 = c1;
quantity1 = q1;
code2 = c2;
quantity2 = q2;
calcTotalPrice=ctp;
}
//Mutator methods
public void setCode1(char c1)
{
code1 = c1;
}
14
public void setQuantity1(int q1)
{
quantity1 = q1;
}
public void setCode2(char c2)
{
code2 = c2;
}
public void setQuantity2(int q2)
{
quantity2= q2;
}
public void setCalcTotalPrice(double ctp)
{
calcTotalPrice=ctp;
}
//accessor methods
public char getCode1()
{
return code1;
}
public int getQuantity1()
{
return quantity1;
}
public int getCode2()
{
return code2;
}
15
public int getQuantity2()
{
return quantity2;
}
16
• CalculateTotal
import java.io.*;
import javax.swing.JOptionPane;
public class CalculateTotal extends PolyCustomer {
public void calculateTotal (char food, int qFood, int drink, int qDrink) throws IOException {
try {
double totalFood, totalDrink, totalPrice;
switch (food)
{
case 'A':
totalFood = 5.00 * qFood;
break;
case 'B':
totalFood = 7.00 * qFood;
break;
case 'C':
totalFood = 10.00 * qFood;
break;
default :
totalFood = 0.0;
break;
}
switch (drink)
{
case 1 :
totalDrink = 2.50 * qDrink;
break;
17
case 2 :
totalDrink = 5.00 * qDrink;
break;
case 3 :
totalDrink = 3.00 * qDrink;
break;
default:
totalDrink = 0.0;
break;
}
//set template
ofile1.println("******Customer List******\n");
ofile1.println("Name\t\tTable Number \t\tFood\t\tFood
Quantity\t\tDrinks\t\tDrinks Quantity\t\tTotal Price (RM)\n");
ofile1.println(super.getName() +"\t\t" + super.getTableNum() + "\t\t\t"+ food
+ "\t\t" + qFood + "\t\t\t" + drink + "\t\t\t" + qDrink + "\t\t\t" + totalPrice);
//Close Customers List
ofile1.close();
System.out.println("Input data has been saved to Customers List.txt");
JOptionPane.showMessageDialog(null,"RECEIPT\n"
+ "**************\n"
+ "Food code: " + food +
"\n"
+ "Quantity: " + qFood +
"\n"
18
+ "Drink code: " + drink
+ "\n"
+ "Quantity: " + qDrink +
"\n"
+ "Total Bill: RM" +
totalPrice + "\n"
+ "Thank you and have a
nice day" + "\n"
+ "**************");
} catch (IOException e) {
JOptionPane.showMessageDialog(null, "Error opening file!");
}
}
}
19
• Menu
import javax.swing.JOptionPane;
public class menu extends PolyCustomer
{
public menu()
{
super();
}
public void print()
{
JOptionPane.showMessageDialog(null,
"*************************************************\n"
+"| Code | Menu | Price (RM) |\n"
+"| A | Nasi Goreng Special | 5.00 |\n"
+"| B | Kuetiau Goreng Special| 7.00 |\n"
+"| C | Chicken Chop USA | 10.00 |\n"
+"| 1 | Milo/Nescafe/Teh Ais | 2.50 |\n"
+"| 2 | Coconut Shake | 5.00 |\n"
+"| 3 | Fresh juice | 3.00 |\n"
+"*************************************************\n");
}
}
20
OUTPUT OF THE PROGRAM
21
22
23
SCORING RUBRICS
Remarks
NO. Category
Weak Moderate Good Very Achieve all
Good requirements
1 2 3 4
1 Report’s format and
Include all the necessary information and it is well
content
documented.
2 1 2 3 4 5
UML Diagram
UML diagram match with the system implementation
1 2 3 4
3 Clarity of program’s (code) The program is clearly written (indented) as well as easy
presentation to understand. Each of the process is well
documented/commented.
1 2 3 4
4 Structure and algorithm of
a program The program can solve the problem completely. There is no
syntax error, logic error and run-time error.
1 2 3 4 5
Compulsory topics to
5
be included
Apply ALL OOP concepts, and File I/0 within the algorithm
of the program.
1 2 3 4
6 Result/Output
The program produced expected output with accurate
and presentable format.
1 2 3 4
7 Report overall quality
The report is well written and documented. Clearly explains
what the project is all about.
24