Course Solutions Uncategorized (Solved) : Code Far S Basic Java Class Purpose Code Prompt User 10 Integers Display Largest Smallest Q31507210 . . . .

(Solved) : Code Far S Basic Java Class Purpose Code Prompt User 10 Integers Display Largest Smallest Q31507210 . . . .

 

This is my code so far and it’s for a basic Java class. Thepurpose for the code is to prompt the user for 10 integers and thendisplay the largest and smallest integer that was inputed. I wasable to ask the user for the 10 integers and display the largestnumber; however, the smallest number isn’t shown. It just displaysthat the smallest integer is 0.

E import java.util.Scanner; public class Largesmall public static void main (String [] args) int counter 1; int largest = 0; int smallest 0; int number0; Scanner input- new Scanner(System.in); while (counter <= 10) { System.out.print (Enter number: ); number -input.nextInt); if (number largest) largest number; Jelse if(numbersmallest) smallestnumber; Jelse System.out.print(Number isnt distinct) countercounter 1; System.out.println(Largest number is: + largest); System.out.println( Smallest number is: smallest);

E

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Designing Spherical Tank Radius R 3m See Figure Hold Water Small Village Developing Countr Q37614992 . . . .(Solved) : Designing Spherical Tank Radius R 3m See Figure Hold Water Small Village Developing Countr Q37614992 . . . .

UseMATLAB<br/><img src="https://media.cheggcdn.com/media%2Fad1%2Fad1af834-0b46-4e19-a810-74e8f7c2b156%2Fimage.png" alt="You are designing a spherical tank of radius R=3m (see figure below) to hold water for a small village in a developing countr" aria-describedby="d3f"/>You are designing a spherical