Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.82 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class SalesProgram {
  6.  
  7.     // Password Definitions
  8.     public static String inPassword;
  9.     public static String password = "YouCantGetThis";
  10.  
  11.     // Welcoming Menu
  12.     public static void displayMenu_Greet() {
  13.  
  14.         System.out.println("###### WELCOME ######");
  15.         System.out.println("1 - Login");
  16.         System.out.println("2 - Register");
  17.         System.out.println("3 - Exit");
  18.         System.out.println("###### WELCOME ######");
  19.         System.out.println();
  20.         System.out.print("Choice: ");
  21.  
  22.     }
  23.  
  24.     // Login Menu
  25.     public static void displayMenu_Login() {
  26.  
  27.         System.out.println("###### LOGIN ######");
  28.         System.out.println("Please enter your password");
  29.         System.out.println("###### LOGIN ######");
  30.         System.out.println();
  31.         System.out.print("Password: ");
  32.         Scanner in = new Scanner(System.in);
  33.         inPassword = in.nextLine();
  34.         System.out.println();
  35.  
  36.         // Password verification
  37.         if (inPassword.equals(password)) {
  38.             displayMenu_Inventory();
  39.         }
  40.  
  41.         // Password Failure
  42.         else {
  43.             System.out.println("Password incorrect, returned to Greeting Screen");
  44.             System.out.println();
  45.             displayMenu_Greet();
  46.         }
  47.  
  48.     }
  49.  
  50.     // Register Menu
  51.     public static void displayMenu_Register() {
  52.  
  53.         System.out.println("###### REGISTER ######");
  54.         System.out.println("Please create a Password");
  55.         System.out.println("###### REGISTER ######");
  56.         System.out.println();
  57.         System.out.print("New Password: ");
  58.  
  59.         // Password Registration
  60.         Scanner in = new Scanner(System.in);
  61.         inPassword = in.nextLine();
  62.  
  63.         password = inPassword;
  64.  
  65.         System.out.println();
  66.         System.out.println("You have now regisered in the program.");
  67.         System.out.println("Returning you to Greeting Page to Log-In.");
  68.         System.out.println();
  69.         displayMenu_Greet();
  70.  
  71.     }
  72.  
  73.     // (Nested Menu) Welcoming Menu -> Inventory
  74.     public static void displayMenu_Inventory() {
  75.  
  76.         System.out.println("###### INVENTORY ######");
  77.         System.out.println("1 - Import Inventory & Prices");
  78.         System.out.println("2 - Create Inventory & Prices");
  79.         System.out.println("3 - Delete Inventory & Prices");
  80.         System.out.println("4 - Exit");
  81.         System.out.println("###### INVENTORY ######");
  82.         System.out.print("Choice: ");
  83.  
  84.     }
  85.  
  86.     public static void displayMenu_Logout() {
  87.  
  88.         System.out.println("###### LOGOUT / EXIT ######");
  89.         System.out.println("You have logged out / exited and your shift has ended.");
  90.         System.out.println("Goodbye :)");
  91.         System.out.println("###### LOGOUT / EXIT ######");
  92.  
  93.     }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement