binibiningtinamoran

WeddingEvent.java

Nov 25th, 2020 (edited)
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.78 KB | None | 0 0
  1. import java.util.ArrayList;
  2.  
  3. public class WeddingEvent extends Event {
  4.  
  5.     // Dinner choices
  6.     public final static String[] APPETIZERS = { "House Salad", "Ceasar Salad", "Lobster Bisque Soup",
  7.             "Broccoli Cheddar Soup" };
  8.     public final static String[] ENTREES = { "Chicken Marsala", "Filet Mignon", "Basked Salmon", "Vegetarian Lasagna",
  9.             "Portobello Mushroom Sandwhich" };
  10.     public static final String[] DESSERTS = { "Strawberry Cheescake", "Tiramisu", "Chocolate Lava Cake" };
  11.     private static final int eventType = 0;
  12.     private ArrayList<Employee> employeeArrayList;
  13.  
  14.     private int appetizer;
  15.     private int entree1;
  16.     private int entree2;
  17.     private int dessert;
  18.     public boolean isBuffetStyle;
  19.  
  20.     // Create event with user inputs of Event Number, Number of Guests, Phone
  21.     // Number, appetizer choice, entree choices, dessert choice, buffet option
  22.     // and Type of Event
  23.     public WeddingEvent(String eventNum, int numOfGuests, String phoneNumber, int appetizer,
  24.             int entree1, int entree2, int dessert, boolean isBuffetStyle,
  25.             ArrayList<Employee> employeeArrayList) {
  26.         super(eventNum, numOfGuests, phoneNumber, eventType);
  27.         setEmployeeArrayList(employeeArrayList);
  28.         setAppetizer(appetizer);
  29.         setEntree1(entree1);
  30.         setEntree2(entree2);
  31.         setDessert(dessert);
  32.         setIsBuffetStyle(isBuffetStyle);
  33.     }
  34.  
  35.     // Default input information
  36.     public WeddingEvent() {
  37.         super("A000",0,"0000000000",0);
  38.         this.appetizer = 0;
  39.         this.entree1 = 0;
  40.         this.entree2 = 0;
  41.         this.dessert = 0;
  42.         this.isBuffetStyle = false;
  43.     }
  44.  
  45.     public void setEmployeeArrayList(ArrayList<Employee> employeeArrayList) {
  46.         this.employeeArrayList = new ArrayList <>(employeeArrayList);
  47.     }
  48.  
  49.     public ArrayList<Employee> getEmployeeArrayList() {
  50.         return employeeArrayList;
  51.     }
  52.  
  53.     // Set appetizer choice
  54.     public void setAppetizer(int appetizer) {
  55.         if (appetizer <= APPETIZERS.length && appetizer >= 0) {
  56.             this.appetizer = appetizer;
  57.         } else {
  58.             this.appetizer = 0;
  59.         }
  60.     }
  61.  
  62.     // Get appetizer choice
  63.     public int getAppetizer() {
  64.         return appetizer;
  65.     }
  66.  
  67.     // Get appetizer choice
  68.     public String getAppetizerChoice() {
  69.         return APPETIZERS[appetizer];
  70.     }
  71.  
  72.     // Set entree 1 choice
  73.     public void setEntree1(int entree1) {
  74.         if (entree1 <= ENTREES.length && entree1 >= 0) {
  75.             this.entree1 = entree1;
  76.         } else {
  77.             this.entree1 = 0;
  78.         }
  79.     }
  80.  
  81.     // Get entree 1 choice
  82.     public int getEntree1() {
  83.         return entree1;
  84.     }
  85.  
  86.     // Get entree 1 choice
  87.     public String getEntree1Choice() {
  88.         return ENTREES[entree1];
  89.     }
  90.  
  91.     // Set entree 2 choice
  92.     public void setEntree2(int entree2) {
  93.         if (entree2 <= ENTREES.length && entree2 >= 0) {
  94.             this.entree2 = entree2;
  95.         } else {
  96.             this.entree2 = 0;
  97.         }
  98.     }
  99.  
  100.     // Get entree 2 choice
  101.     public int getEntree2() {
  102.         return entree2;
  103.     }
  104.  
  105.     // Get entree 2 choice
  106.     public String getEntree2Choice() {
  107.         return ENTREES[entree2];
  108.     }
  109.  
  110.     // Set dessert choice
  111.     public void setDessert(int dessert) {
  112.         if (dessert <= DESSERTS.length && dessert >= 0) {
  113.             this.dessert = dessert;
  114.         } else {
  115.             this.dessert = 0;
  116.         }
  117.     }
  118.  
  119.     public int getDessert() {
  120.         return dessert;
  121.     }
  122.  
  123.     public String getDessertChoice() {
  124.         return DESSERTS[dessert];
  125.     }
  126.  
  127.     private void setIsBuffetStyle(boolean isBuffetStyle) {
  128.         this.isBuffetStyle = isBuffetStyle;
  129.     }
  130.  
  131.     // Get buffet style
  132.     public boolean getIsBuffetStyle() {
  133.         return isBuffetStyle;
  134.     }
  135.  
  136.     // Output dinner menu based on user input of meal
  137.     public String getMenu() {
  138.         String displayMenu;
  139.         if (isBuffetStyle) {
  140.             displayMenu = "The menu for this " + EVENT_TYPES[getEventType()]
  141.                     + " will be served buffet style and will include " + APPETIZERS[getAppetizer()] + " to start, with "
  142.                     + ENTREES[getEntree1()] + " or " + ENTREES[getEntree2()] + " for the main course, and "
  143.                     + DESSERTS[getDessert()] + " for dessert.";
  144.         } else {
  145.             displayMenu = "The menu for this " + EVENT_TYPES[getEventType()]
  146.                     + " will not be served buffet style and will include " + APPETIZERS[getAppetizer()] + " to start, with "
  147.                     + ENTREES[getEntree1()] + " or " + ENTREES[getEntree2()] + " for the main course, and "
  148.                     + DESSERTS[getDessert()] + " for dessert.";
  149.         }
  150.         return displayMenu;
  151.  
  152.     }
  153.  
  154. }
Add Comment
Please, Sign In to add comment