Question: Java The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove

Java

The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.

-- The DebugFive3 class compiles without error.

-- The DebugFive3 program accepts user input and displays the correct output.

An example of the program is shown below:

Please enter item number >> 439 Valid - Item in Automotive Department

CODE:

import java.util.Scanner;

public class DebugFive3

{

public static void main (String args[])

{

int item;

String output;

final int LOW = 111;

final int HIGH = 999;

final int CUTOFF = 500;

Scanner input = new Scanner(System.in);

System.out.print("Please enter item number >> ");

item = input.nextInt();

if(item > LOW)

output = "Item number too low";

else

if(item >= HIGHH)

output = "Item number too high";

else

if(item == CUTOFF)

output = "Valid - Item in Automotive Department";

else

output = "Valid - Item in Housewares Department";

System.out.println(output);

}

}

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!