Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.supinfo.javapetstoreconsole.launcher;
- import java.util.Scanner;
- public class Launch
- {
- public static void main(String[] args)
- {
- Scanner scanner = new Scanner(System.in);
- int choice = 0;
- while(choice != 5) {
- System.out.println(Launch.displayMainMenu());
- choice = scanner.nextInt();
- System.out.println(Launch.computeMainMenuChoice(choice));
- }
- }
- public static String displayMainMenu()
- {
- return "1 - Add an item\n"
- + "2 - Update an item\n"
- + "3 - Find an item\n"
- + "4 - Delete an item\n"
- + "5 - Quit";
- }
- public static String computeMainMenuChoice(int choice)
- {
- switch(choice) {
- case 1:
- return "You choose to add an item";
- case 2:
- return "You choose to update an item";
- case 3:
- return "You choose to find an item";
- case 4:
- return "You choose to delete an item";
- case 5:
- return "You choose to quit";
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement