Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class menu {
- user employee = new user();
- //credentials
- private String userName;
- private String passWord;
- private boolean loggedin = false;
- // menu selections
- private int menuInput = 0;
- private int selection = 0;
- // house total area
- private double length = 0;
- private double width = 0;
- private double totalArea;
- // house supplies
- private double wood = 0;
- private double concrete = 0;
- private double flooring = 0;
- private double roofing = 0;
- private double insulation = 0;
- private double windowsAndDoors = 0;
- private double cabinets = 0;
- private double paint = 0;
- Scanner scan = new Scanner(System.in);
- menu() {
- do {
- employee.login();
- System.out.println("Please type in your username: ");
- setUserName(scan.next());
- System.out.println("Please type in your password: ");
- setPassWord(scan.next());
- for ()
- if (getUserName().equals(employee.getUserName()))
- } while(loggedin = false);
- do {
- System.out.println("Select Option:\n1.) Enter House Dimensions\n2.)Enter supplies\n");
- while (!scan.hasNextInt()) {
- System.out.println("that is not a number");
- scan.next();
- }
- setMenuInput(scan.nextInt());
- // switch statement
- switch(menuInput)
- {
- // case statements
- case 1 :
- System.out.println("Enter dimensions for house: Length * Width");
- length = scan.nextDouble();
- width = scan.nextDouble();
- case 2 :
- do {
- System.out.println("Select supplies and enter amount needed");
- System.out.println("1.)Wood\n2.)Concrete\n3.)Flooring\n4.)Roofing\n5.)Insulation\n6.)Windows and Doors\n7.)Cabinets\n8.)Paint\n99.)Exit\n");
- while (!scan.hasNextInt()) {
- System.out.println("that is not a number");
- scan.next();
- }
- setSelection(scan.nextInt());
- switch (selection)
- {
- case 1 :
- System.out.print("Enter amount of wood needed: ");
- setWood(scan.nextDouble());
- System.out.println();
- break;
- case 2 :
- System.out.print("Enter amount of Concrete needed: ");
- setConcrete(scan.nextDouble());
- System.out.println();
- break;
- case 3 :
- System.out.print("Enter amount of Flooring needed: ");
- setFlooring(scan.nextDouble());
- System.out.println();
- break;
- case 4 :
- System.out.print("Enter amount of Roofing needed: ");
- setRoofing(scan.nextDouble());
- System.out.println();
- break;
- case 5 :
- System.out.print("Enter amount of Insulation needed: ");
- setInsulation(scan.nextDouble());
- System.out.println();
- break;
- case 6 :
- System.out.print("Enter amount of Windows and Doors needed: ");
- setWindowsAndDoors(scan.nextDouble());
- System.out.println();
- break;
- case 7 :
- System.out.print("Enter amount of Cabinets needed: ");
- setCabinets(scan.nextDouble());
- System.out.println();
- break;
- case 8 :
- System.out.print("Enter amount of Paint needed: ");
- setPaint(scan.nextDouble());
- System.out.println();
- break;
- case 99 :
- System.out.println("Returning to Menu\n");
- break;
- default :
- System.out.println("I'm not sure what happened. Try again.");
- }
- } while (selection != 99);
- // Statements
- case 3 :
- // Statements
- break;
- case 4 :
- System.out.println("Add new employee");
- employee.addEmployee();
- break;
- case 5 :
- employee.listUsers();
- break;
- case 99 :
- // Statements
- break;
- default :
- // Statements
- }
- } while (menuInput != 99);
- }
- public String getUserName() {
- return userName;
- }
- public void setUserName(String userName) {
- this.userName = userName;
- }
- public String getPassWord() {
- return passWord;
- }
- public void setPassWord(String passWord) {
- this.passWord = passWord;
- }
- public int getMenuInput() {
- return menuInput;
- }
- public void setMenuInput(int menuInput) {
- this.menuInput = menuInput;
- }
- public int getSelection() {
- return selection;
- }
- public void setSelection(int selection) {
- this.selection = selection;
- }
- public double getWood() {
- return wood;
- }
- public void setWood(double wood) {
- this.wood = wood;
- }
- public double getConcrete() {
- return concrete;
- }
- public void setConcrete(double concrete) {
- this.concrete = concrete;
- }
- public double getFlooring() {
- return flooring;
- }
- public void setFlooring(double flooring) {
- this.flooring = flooring;
- }
- public double getRoofing() {
- return roofing;
- }
- public void setRoofing(double roofing) {
- this.roofing = roofing;
- }
- public double getInsulation() {
- return insulation;
- }
- public void setInsulation(double insulation) {
- this.insulation = insulation;
- }
- public double getWindowsAndDoors() {
- return windowsAndDoors;
- }
- public void setWindowsAndDoors(double windowsAndDoors) {
- this.windowsAndDoors = windowsAndDoors;
- }
- public double getCabinets() {
- return cabinets;
- }
- public void setCabinets(double cabinets) {
- this.cabinets = cabinets;
- }
- public double getPaint() {
- return paint;
- }
- public void setPaint(double paint) {
- this.paint = paint;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement