Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago