From 9560e457a2883cab91c3f1f0935383688ccd1720 Mon Sep 17 00:00:00 2001 From: Mariam-Essam-Farouq <61471415+Mariam-Essam-Farouq@users.noreply.github.com> Date: Thu, 26 Mar 2020 20:44:06 +0200 Subject: [PATCH 1/2] --- Project/OSTask1/src/CustomerManagerApp.java | 34 ++++++++++++--------- student.md | 14 +++++++++ 2 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 student.md diff --git a/Project/OSTask1/src/CustomerManagerApp.java b/Project/OSTask1/src/CustomerManagerApp.java index 2a27245..45d2fc6 100644 --- a/Project/OSTask1/src/CustomerManagerApp.java +++ b/Project/OSTask1/src/CustomerManagerApp.java @@ -1,5 +1,5 @@ import java.util.List; - +import java.util.Scanner; public class CustomerManagerApp { // declare class variables @@ -16,21 +16,27 @@ public static void main(String[] args) { displayMenu(); // perform 1 or more actions - String action = ""; - while (!action.equalsIgnoreCase("exit")) { + int action = 0; + + + + + while (action !=5) { // get the input from the user - action = Console.getString("Enter a command: "); + Scanner scan = new Scanner(System.in); + System.out.print("Enter a command: "); + action = scan.nextInt(); System.out.println(); - if (action.equalsIgnoreCase("list")) { + if (action==1) { displayAllCustomers(); - } else if (action.equalsIgnoreCase("add")) { + } else if (action==2) { addCustomer(); - } else if (action.equalsIgnoreCase("del") || action.equalsIgnoreCase("delete")) { + } else if (action==3) { deleteCustomer(); - } else if (action.equalsIgnoreCase("help") || action.equalsIgnoreCase("menu")) { + } else if (action==4) { displayMenu(); - } else if (action.equalsIgnoreCase("exit")) { + } else if (action==5) { System.out.println("Bye.\n"); } else { System.out.println("Error! Not a valid command.\n"); @@ -40,11 +46,11 @@ public static void main(String[] args) { public static void displayMenu() { System.out.println("COMMAND MENU"); - System.out.println("list - List all customers"); - System.out.println("add - Add a customer"); - System.out.println("del - Delete a customer"); - System.out.println("help - Show this menu"); - System.out.println("exit - Exit this application\n"); + System.out.println("1 - List all customers"); + System.out.println("2 - Add a customer"); + System.out.println("3 - Delete a customer"); + System.out.println("4 - Show this menu"); + System.out.println("5 - Exit this application\n"); } public static void displayAllCustomers() { diff --git a/student.md b/student.md new file mode 100644 index 0000000..e1e3166 --- /dev/null +++ b/student.md @@ -0,0 +1,14 @@ +**Mariam Essam Farouq Abdul-Shafi** +****** +![picture-example][1]. +****** +*section6* + + + + + + + + +[1]: https://i.ibb.co/TtJZTfj/picture.png "picture-example" \ No newline at end of file From 281c8317a8a25305679d4a79e6c5d4efda3dcea5 Mon Sep 17 00:00:00 2001 From: Mariam-Essam-Farouq <61471415+Mariam-Essam-Farouq@users.noreply.github.com> Date: Thu, 26 Mar 2020 21:03:35 +0200 Subject: [PATCH 2/2] Add mariam-essam-farouq to contributors list --- Project/OSTask1/src/BufferdReader.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Project/OSTask1/src/BufferdReader.java diff --git a/Project/OSTask1/src/BufferdReader.java b/Project/OSTask1/src/BufferdReader.java new file mode 100644 index 0000000..09e58da --- /dev/null +++ b/Project/OSTask1/src/BufferdReader.java @@ -0,0 +1,13 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +/** + * + * @author W10 + */ +class BufferdReader { + +}