Write a code fragment that reads 10 integer values from the user and prints the highest value entered.

What will be an ideal response?


```
Scanner scan = new Scanner(System.in);
int max, number;
System.out.print("Enter an integer: ");
max = scan.nextInt();
for (int count = 2; count <= 10; count++)
{
System.out.print("Enter another integer: ");
number = scan.nextInt();
if (number > max)
max = number;
}
System.out.println("The highest value is :" + max);
```

Computer Science & Information Technology

You might also like to view...

RGB stands for ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

According to Davis' model, ________ are the things we must not do to obey the rules.

A. lies B. cons C. prohibitions D. sins

Computer Science & Information Technology

Changing font colors, resizing text boxes, and resizing controls improve form ________

A) quality B) precision C) accuracy D) usability

Computer Science & Information Technology

A(n) ________ is a rule that Solver has to enforce to reach the objective value

Fill in the blank(s) with correct word

Computer Science & Information Technology