Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions

Question

5. List the forces that shape a groups decisions

Answered: 1 week ago

Question

4. Identify how culture affects appropriate leadership behavior

Answered: 1 week ago