Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main (String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.println("Welcome to the To Do list app");
- int length = 0;
- String[] listToDo = new String[length];
- String menu = "edit";
- while (menu != "exit") {
- System.out.println("type *edit* to edit, *view* to read and *cancel* to cancel");
- String userListItem = new String();
- menu = input.next();
- if (menu == "edit") {
- System.out.println("How many items do you want to add to the list?");
- System.out.println("hit enter to move to the next line or enter *:q!* to exit");
- length = input.nextInt();
- for (int counter = 0; counter < length; counter++) {
- userListItem[counter] = input.nextLine();
- if (!userListItem.isEmpty()) {
- listToDo[counter] = userListItem;
- }
- if (userListItem.equals(":q!")) {
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement