Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Find the output import java.util.*; public class DebugFive4 { public static void main (String args[]) { Scanner input = new Scanner(System.in); int one, two,

Find the output

 

import java.util.*;

public class DebugFive4

{

public static void main (String args[])

{

Scanner input = new Scanner(System.in);

int one, two, three, four;

String str, output;

System.out.println("Enter an integer");

str = input.next();

one = Integer.parseInt(str);

System.out.println("Enter an integer");

str = input.next();

two = Integer.parseInt(str);

System.out.println("Enter an integer");

str = input.next();

three = Integer.parseInt(str);

System.out.println("Enter an integer");

str = input.next();

four = Integer.parseInt(str);

if(one > two && one > three && one > four){

output = "Highest is " + four;

}

else

if(two > one && two > three && two > four){

output = "Highest is " + three;

}

else

if(three > one && three > two && three > four)

{

output = "Highest is " + three;

}

else

{

output = "Highest is " + four;

}

System.out.println(output);

input.close();


}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Answer Lets go through the code and determine the output The ... 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

Building Java Programs A Back To Basics Approach

Authors: Stuart Reges, Marty Stepp

5th Edition

013547194X, 978-0135471944

More Books

Students also viewed these Programming questions

Question

Avoid evasiveness. Be direct with your answers when possible.

Answered: 1 week ago

Question

How do we do subnetting in IPv6?Explain with a suitable example.

Answered: 1 week ago

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago

Question

What is code reuse? How does inheritance help achieve code reuse?

Answered: 1 week ago

Question

What are some active listening skills? AppendixLO1

Answered: 1 week ago