Question: Currently having issues trying to prompt a user for input and assign the input to a variable( either a string or integer). the values are


static int count 1; static String function; static Integer tineNum = null; static Integer tineNum2 null; System.out.println("What function do you wish to execute?"); boolean enter = false; String keystroke; while(enter=false) { function=keyboard.next(); keystroke = keyboard.next(); if(keystroke.equals("")) { enter=true; } lineNum=keyboard.nextInt(); keystroke = keyboard.next(); if(keystroke.equals("")) { enter=true; } lineNum2=keyboard.nextInt(); keystroke - keyboard.next(); if (keystroke.equals("")) { enter=true; } } System.out.println(function + Line Num+ LineNum2+count); makeEdit(function, LineNum, lineNum2, count); I public static void makeEdit(String function, Integer lineNum, Integer lineNum2, int count) { if (function.equalsIgnoreCase("i")&& lineNum==null && lineNum2= null) { executeInsert(count); if(function.equalsignoreCase("I") && lineNum=null && lineNum2==null) { executeInserton(lineNum); 3 if(function.equalsIgnorecase("L") && lineNum==null && lineNum2==null) { listContent(); if(function.equals IgnoreCase("D") && lineNum null && lineNum2=null) I DeleteContent (count); if (function.equalsIgnoreCase("D") && lineNum=null && lineNum2 null) executeDeleteLine(lineNum); if (function.equalsIgnoreCase("0") && lineNum! -null && lineNum2!=null) executeDeletelines(lineNum, lineNum2); 3 if(function.equalsignoreCase("A") && lineNumunull && lineNum2 null)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
