May 4, 2019 02:23 PM
(This post was last modified: May 5, 2019 12:39 AM by trollgirll.)
Hey guys !
I'm making a restaurant management system.
The system contains the:
Restaurant class
Table class
Customer class
Menu class
Item Class
Order Class
Bill Class
My Restaurant Class contains Array List of Customers and an Array List of Tables
My main problem is that how can i make the customer:
reserve a table giving the table number at a certain time.
cancel table reservation.
Find available tables.
When all tables are occupied no other customers are allowed to reserve anymore
and how could i use them in the main ?
This is the Customer Class:
public class Customer {
private String fname;
private String lname;
private String pbn;
private int ID ;
static int n;
Customer order;
public Customer() {
ID=0;
this.fname = "";
this.lname = "";
this.pbn = "";
}
public Customer(String fname, String lname, String pbn) {
n++;
this.ID=n;
this.fname = fname;
this.lname = lname;
this.pbn = pbn;
}
public String getFname() {
return fname;
}
public void setFname(String fname) {
this.fname = fname;
}
public void setCustomerId(int ID) {
n++;
this.ID = n;
}
public static void setN(int n) {
Customer.n = n;
}
public String getLname() {
return lname;
}
public String getCustomerName(){
Customer c1= new Customer();
String cn=c1.getFname()+c1.getLname();
return cn;
}
public void setLname(String lname) {
this.lname = lname;
}
public String getPbn() {
return pbn;
}
public void setPbn(String pbn) {
this.pbn = pbn;
}
@Override
public String toString() {
return "Customer{" + "fname=" + fname + ", lname=" + lname + ", pbn=" + pbn + ", ID=" + ID + '}';
}
public Customer getOrder() {
return order;
}
public void setOrder(Customer mOrder) {
this.order = mOrder;
}
}
Table Class:
private boolean mOccupied;
public Table(){
mOccupied = false;
}
public boolean isOccupied(){
return
mOccupied == true;
}
public void bookTable(){
mOccupied = true;
}
public void releaseTable(){
mOccupied = false;
}
}
Restaurant Class:
List<Table> tables;
private Date date;
int reservationNumber;
static int n ;
List<Customer> mcustomers;
public Restaurant() {
n++;
this.reservationNumber = n;
}
public List<Table> tables() {
return tables;
}
public void setTables(List<Table> tables) {
this.tables = tables;
}
public void addTables(List<Table> tables) {
this.tables.addAll(tables);
}
public Date date() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public int reservationNumber() {
return reservationNumber;
}
@Override
public String toString() {
return "Reservation [reservationNumber=" + reservationNumber + ", tables="
+ tables + ", date=" + date + "]";
}
Could anyone help please !!
I'm making a restaurant management system.
The system contains the:
Restaurant class
Table class
Customer class
Menu class
Item Class
Order Class
Bill Class
My Restaurant Class contains Array List of Customers and an Array List of Tables
My main problem is that how can i make the customer:
reserve a table giving the table number at a certain time.
cancel table reservation.
Find available tables.
When all tables are occupied no other customers are allowed to reserve anymore
and how could i use them in the main ?
This is the Customer Class:
public class Customer {
private String fname;
private String lname;
private String pbn;
private int ID ;
static int n;
Customer order;
public Customer() {
ID=0;
this.fname = "";
this.lname = "";
this.pbn = "";
}
public Customer(String fname, String lname, String pbn) {
n++;
this.ID=n;
this.fname = fname;
this.lname = lname;
this.pbn = pbn;
}
public String getFname() {
return fname;
}
public void setFname(String fname) {
this.fname = fname;
}
public void setCustomerId(int ID) {
n++;
this.ID = n;
}
public static void setN(int n) {
Customer.n = n;
}
public String getLname() {
return lname;
}
public String getCustomerName(){
Customer c1= new Customer();
String cn=c1.getFname()+c1.getLname();
return cn;
}
public void setLname(String lname) {
this.lname = lname;
}
public String getPbn() {
return pbn;
}
public void setPbn(String pbn) {
this.pbn = pbn;
}
@Override
public String toString() {
return "Customer{" + "fname=" + fname + ", lname=" + lname + ", pbn=" + pbn + ", ID=" + ID + '}';
}
public Customer getOrder() {
return order;
}
public void setOrder(Customer mOrder) {
this.order = mOrder;
}
}
Table Class:
private boolean mOccupied;
public Table(){
mOccupied = false;
}
public boolean isOccupied(){
return
mOccupied == true;
}
public void bookTable(){
mOccupied = true;
}
public void releaseTable(){
mOccupied = false;
}
}
Restaurant Class:
List<Table> tables;
private Date date;
int reservationNumber;
static int n ;
List<Customer> mcustomers;
public Restaurant() {
n++;
this.reservationNumber = n;
}
public List<Table> tables() {
return tables;
}
public void setTables(List<Table> tables) {
this.tables = tables;
}
public void addTables(List<Table> tables) {
this.tables.addAll(tables);
}
public Date date() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public int reservationNumber() {
return reservationNumber;
}
@Override
public String toString() {
return "Reservation [reservationNumber=" + reservationNumber + ", tables="
+ tables + ", date=" + date + "]";
}
Could anyone help please !!





![[Image: vibesignature.gif]](https://i.ibb.co/8LvxwtYQ/vibesignature.gif)