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...

Describe how a non-recoverable situation could arise if write locks are released after the last operation of a transaction but before its commitment.

What will be an ideal response?

Computer Science & Information Technology

Microsoft Excel is text and data processing software and is not suited for working with formulas.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Which of the following ports has the fastest data transfer rate?

A) SVGA B) FireWire 800 C) USB 3.0 D) DVI

Computer Science & Information Technology

What is the best option for adding a calculation to a PivotTable that does not already exist?

A) PivotTool Calculation B) Function C) Custom function D) Calculated field

Computer Science & Information Technology