Package Customer

Source Code of Customer.Customer

package Customer;
import Server.*;
import Eatables.*;
import java.io.*;
public class Customer
{

  public static Server s1;
  public void callserver()
  {
    s1=new Server();
  }
  public String paybill(float billvalue,float value)
  {
    String Thank;
    float balamnt=billvalue-value;
    if (balamnt>0.0f)
    {
      Thank="Here is your balance amount Rs."+balamnt+"\n Thank you for coming here";
      return Thank;
    }
    Thank="Thank you for coming here ";
    return Thank;
   
  }

  public void orderFood(String[] food) throws Exception
  {
    //Server s1=new Server();
    Foods[] f=s1.orderItem(food);
    for (Foods ff: f)
                        {
                                System.out.println(ff.name +" Received");
                                 this.eating(ff);
                        }
 
  }

  public void eating(Foods f1)
  {
    System.out.println("Customer eating "+f1.name);
    //finishEating(f1);
  }

  public void finishEating()
  {
    System.out.println("Finished eating");
    //Server s1=new Server();
    //s1.bill(f1);
  }
 
  public void menu()
  {
    //Server s1=new Server();
    String menu=s1.giveMenu();
    System.out.println(menu);
  }
  public static void main(String[] args) throws Exception
  {
      Customer cus = new Customer();
      cus.callserver();
      System.out.println("Welcome to Hotel Jesinth Bhavan\n1.MenuCard -----> press-1 \n2.Exit -----> press any key");
                  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                        System.out.print("Please Select the option for call server or Exit : ");
      try
      {
                        String cal=br.readLine();
      if (cal.equals("1"))
      {
      cus.menu();
      System.out.print("Select ordering the food with space: ");
       
      String[] food=br.readLine().split(" ");
                  cus.orderFood(food);
             cus.finishEating();
      }
      else
      {
        System.out.println("Thank you visit again");
      }
      }
      catch(IOException e)
      {
        System.out.println(e);
      }
  }
   
}
TOP

Related Classes of Customer.Customer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.