answersLogoWhite

0


Best Answer

import java.util.Scanner;

//A class to find the highest number of 10 user inputs

public class HighApp{

public static void main(String[]args){

Scanner scan = new Scanner(System.in);

int count = 0;

System.out.println("Enter number " + count);

int highest = scan.nextInt(); //first, assume highest

count ++;

while(count <= 10){

System.out.println("Enter number" + count);

int input = scan.nextInt();

if (input > hightest){

highest = input

}//end if statement

count++;

}//end while loop

System.out.println("The highest number entered was " + highest);

}//end main method

}//end HighApp class

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a code fragment that reads 10 integer values from the user and prints the highest value entered?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is a body part that has unique prints?

Your finger pads, your hands, and your feet all have unique prints on them. If your prints are entered in the system, police can find you.


Which Hollywood movie has maximum prints in India?

Avatar has entered record books as the highest grossing movie of all time. Avatar has collected Rs 67 crore, making it the second-biggest Hollywood film ever in India after 2012. It released with only 45 prints


If you have been fingerprinted in Australia will it show up in IAFIS?

IF, your prints were entered into the system, they will be there.


A c plus plus programming that accepts an integer from the user and prints the last digit of the entered integer?

To obtain the last whole digit of a number, use the modulo (%) of the number and 10. The modulo evaluates to the remainder after division. Thus 15%10 returns 5 because 15 divided by 10 is 1 remainder 5. Therefore the last digit of any integer, n, is therefore n%10. The same trick can be used to find the last digit for any base, where n is a base 10 integer. Thus n%8 will return the last octal digit, while n%16 will return the last hexadecimal digit.


Where is the plank of wood in the vegie villain?

When you entered the corn maze, when you were following the corn and saw paw prints on both the sides, I think you took a left turn, when you were supposed to take a right. Take a right and follow the paw prints. There's the plank of wood you need!


Which type of art print is the highest quality?

Art prints created with fabric are one of the highest and best qualities. They are strong and long-lasting and provide a good shading and color remains bright.


Write a program that input a positive integer and prints a triangle using for loop?

write a program that reads in the size of the side of square and then pints a hollow square of that size out of asterisks and blanks?


Who is Thomas prints?

thomas prints invented prints


What is definition for dry wet prints?

wet prints are those in which fabri is either dyed or printed dry prints are the fancy prints like flock prints, burn out prints.


Difference between percent p and percent x in c language?

%p prints a pointer, %x prints an integer. They may be similar, but not the same. Eg.printf ("ptr=%p int=%d\n", main, (int)main);DOS: ptr=0F01:0010 int=10Windows: ptr=:0F010010 int=F010010


How can Implement JAVA code which takes 2 dimensional integer array as input and prints out heaviest island?

public static void main (String args[]) throws IOException { int abc = System.in.read(); }


Write a C program that prompts the user for three decimal numbers and prints them trimmed as integer values. For example, if the user informs the values 13.2, 12.5, 102.231, the program prints out 13, 12, 102?

Here's a simple C program that prompts the user for three decimal numbers, converts them to integers, and prints the trimmed integer values: c Copy code #include int main() { double num1, num2, num3; // Prompt the user for three decimal numbers printf(&quot;Enter three decimal numbers: &quot;); scanf(&quot;%lf %lf %lf&quot;, &amp;num1, &amp;num2, &amp;num3); // Convert and print the trimmed integer values int intNum1 = (int)num1; int intNum2 = (int)num2; int intNum3 = (int)num3; printf(&quot;Trimmed integer values: %d, %d, %d\n&quot;, intNum1, intNum2, intNum3); return 0; } In this program: We declare three variables num1, num2, and num3 to store the decimal numbers entered by the user. We use printf to prompt the user to enter three decimal numbers. We use scanf to read and store the user's input in the variables num1, num2, and num3. We then convert these decimal numbers to integers by casting them using (int) and store them in intNum1, intNum2, and intNum3. Finally, we use printf again to print the trimmed integer values. Compile and run the program, and it will prompt you for three decimal numbers and print their trimmed integer values as requested.