Advertisement
Guest User

Untitled

a guest
Dec 7th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 7.63 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class menu {
  6.  
  7.     user employee = new user();
  8.  
  9.     //credentials
  10.     private String userName;
  11.     private String passWord;
  12.     private boolean loggedin = false;
  13.  
  14.     // menu selections
  15.     private int menuInput = 0;
  16.     private int selection = 0;
  17.  
  18.     // house total area
  19.     private double length = 0;
  20.     private double width = 0;
  21.     private double totalArea;
  22.  
  23.     // house supplies
  24.     private double wood = 0;
  25.     private double concrete = 0;
  26.     private double flooring = 0;
  27.     private double roofing = 0;
  28.     private double insulation = 0;
  29.     private double windowsAndDoors = 0;
  30.     private double cabinets = 0;
  31.     private double paint = 0;
  32.  
  33.     Scanner scan = new Scanner(System.in);
  34.  
  35.     menu() {
  36.  
  37.         do {
  38.             employee.login();
  39.             System.out.println("Please type in your username: ");
  40.             setUserName(scan.next());
  41.             System.out.println("Please type in your password: ");
  42.             setPassWord(scan.next());
  43.  
  44.             for ()
  45.             if (getUserName().equals(employee.getUserName()))
  46.         } while(loggedin = false);
  47.  
  48.  
  49.  
  50.  
  51.          do {
  52.  
  53.              System.out.println("Select Option:\n1.) Enter House Dimensions\n2.)Enter supplies\n");
  54.  
  55.                  while (!scan.hasNextInt()) {
  56.                      System.out.println("that is not a number");
  57.                      scan.next();
  58.                  }
  59.  
  60.  
  61.              setMenuInput(scan.nextInt());
  62.  
  63.              // switch statement
  64.              switch(menuInput)
  65.              {
  66.                  // case statements
  67.                  case 1 :
  68.                      System.out.println("Enter dimensions for house: Length * Width");
  69.                      length = scan.nextDouble();
  70.                      width = scan.nextDouble();
  71.  
  72.                  case 2 :
  73.                      do {
  74.                          System.out.println("Select supplies and enter amount needed");
  75.                          System.out.println("1.)Wood\n2.)Concrete\n3.)Flooring\n4.)Roofing\n5.)Insulation\n6.)Windows and Doors\n7.)Cabinets\n8.)Paint\n99.)Exit\n");
  76.  
  77.                          while (!scan.hasNextInt()) {
  78.                              System.out.println("that is not a number");
  79.                              scan.next();
  80.                          }
  81.                          setSelection(scan.nextInt());
  82.  
  83.                          switch (selection)
  84.                          {
  85.                              case 1 :
  86.                                  System.out.print("Enter amount of wood needed: ");
  87.                                  setWood(scan.nextDouble());
  88.                                  System.out.println();
  89.                                  break;
  90.  
  91.                              case 2 :
  92.                                  System.out.print("Enter amount of Concrete needed: ");
  93.                                  setConcrete(scan.nextDouble());
  94.                                  System.out.println();
  95.                                  break;
  96.  
  97.                              case 3 :
  98.                                  System.out.print("Enter amount of Flooring needed: ");
  99.                                  setFlooring(scan.nextDouble());
  100.                                  System.out.println();
  101.                                  break;
  102.  
  103.                              case 4 :
  104.                                  System.out.print("Enter amount of Roofing needed: ");
  105.                                  setRoofing(scan.nextDouble());
  106.                                  System.out.println();
  107.                                  break;
  108.  
  109.                              case 5 :
  110.                                  System.out.print("Enter amount of Insulation needed: ");
  111.                                  setInsulation(scan.nextDouble());
  112.                                  System.out.println();
  113.                                  break;
  114.  
  115.                              case 6 :
  116.                                  System.out.print("Enter amount of Windows and Doors needed: ");
  117.                                  setWindowsAndDoors(scan.nextDouble());
  118.                                  System.out.println();
  119.                                  break;
  120.  
  121.                              case 7 :
  122.                                  System.out.print("Enter amount of Cabinets needed: ");
  123.                                  setCabinets(scan.nextDouble());
  124.                                  System.out.println();
  125.                                  break;
  126.  
  127.                              case 8 :
  128.                                  System.out.print("Enter amount of Paint needed: ");
  129.                                  setPaint(scan.nextDouble());
  130.                                  System.out.println();
  131.                                  break;
  132.  
  133.                              case 99 :
  134.                                  System.out.println("Returning to Menu\n");
  135.                                  break;
  136.  
  137.                              default :
  138.                                  System.out.println("I'm not sure what happened. Try again.");
  139.  
  140.                          }
  141.  
  142.                      } while (selection != 99);
  143.                      // Statements
  144.  
  145.                  case 3 :
  146.                      // Statements
  147.                      break;
  148.                  case 4 :
  149.                      System.out.println("Add new employee");
  150.                      employee.addEmployee();
  151.                      break;
  152.  
  153.                  case 5 :
  154.                      employee.listUsers();
  155.                      break;
  156.  
  157.  
  158.                  case 99 :
  159.                      // Statements
  160.                      break;
  161.  
  162.                  default :
  163.                      // Statements
  164.              }
  165.          } while (menuInput != 99);
  166.  
  167.  
  168.     }
  169.  
  170.     public String getUserName() {
  171.         return userName;
  172.     }
  173.  
  174.     public void setUserName(String userName) {
  175.         this.userName = userName;
  176.     }
  177.  
  178.     public String getPassWord() {
  179.         return passWord;
  180.     }
  181.  
  182.     public void setPassWord(String passWord) {
  183.         this.passWord = passWord;
  184.     }
  185.  
  186.     public int getMenuInput() {
  187.         return menuInput;
  188.     }
  189.  
  190.     public void setMenuInput(int menuInput) {
  191.         this.menuInput = menuInput;
  192.     }
  193.  
  194.     public int getSelection() {
  195.         return selection;
  196.     }
  197.  
  198.     public void setSelection(int selection) {
  199.         this.selection = selection;
  200.     }
  201.  
  202.     public double getWood() {
  203.         return wood;
  204.     }
  205.  
  206.     public void setWood(double wood) {
  207.         this.wood = wood;
  208.     }
  209.  
  210.     public double getConcrete() {
  211.         return concrete;
  212.     }
  213.  
  214.     public void setConcrete(double concrete) {
  215.         this.concrete = concrete;
  216.     }
  217.  
  218.     public double getFlooring() {
  219.         return flooring;
  220.     }
  221.  
  222.     public void setFlooring(double flooring) {
  223.         this.flooring = flooring;
  224.     }
  225.  
  226.     public double getRoofing() {
  227.         return roofing;
  228.     }
  229.  
  230.     public void setRoofing(double roofing) {
  231.         this.roofing = roofing;
  232.     }
  233.  
  234.     public double getInsulation() {
  235.         return insulation;
  236.     }
  237.  
  238.     public void setInsulation(double insulation) {
  239.         this.insulation = insulation;
  240.     }
  241.  
  242.     public double getWindowsAndDoors() {
  243.         return windowsAndDoors;
  244.     }
  245.  
  246.     public void setWindowsAndDoors(double windowsAndDoors) {
  247.         this.windowsAndDoors = windowsAndDoors;
  248.     }
  249.  
  250.     public double getCabinets() {
  251.         return cabinets;
  252.     }
  253.  
  254.     public void setCabinets(double cabinets) {
  255.         this.cabinets = cabinets;
  256.     }
  257.  
  258.     public double getPaint() {
  259.         return paint;
  260.     }
  261.  
  262.     public void setPaint(double paint) {
  263.         this.paint = paint;
  264.     }
  265.  
  266. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement