Question: The following code is intended to continuously get user integer input and print a message based on the values input. Specifically, if the integer is:

 The following code is intended to continuously get user integer input
and print a message based on the values input. Specifically, if the

The following code is intended to continuously get user integer input and print a message based on the values input. Specifically, if the integer is: . 1: print "create a file." 2: print "open a file." 3: print "close a file." 4: print "delete a file." The program will end if the user inputs any other integer values. int op 1 public class Loopi 2 { 3 public static main (String[] args) 4 { 5 while (true) 6 { 7 Stdin.readInt(); if (op== Stdout.println("create a file."); 10 else if (op == 2) 11 Stdout.println("open a file."); else if (op == 3) 13 Stdout.println("close a file."); else if (op == 4) 15 Stdout.println("delete a file."); 16 } 1) 8 9 12 The program does not work as intended. Answer the following questions: (1) What code do you need to add? and (2) Where do you need to add this code to fix the program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!