Java Programming Help!!

5 pts.
Tags:
Java
Java code
I am trying to write a program and am in desperate need of help. The problem is as follows: Write a program to read in a list of nonnegative integers and to output the largest integer, the smallest integer, and the average of all the integers. The end of the input is indicated by the user entering a negative sentinel value. Note that the sentinel value is not used in finding the largest, smallest, or average. It is only an end marker. The average should be a value of type double, so that the average is computed with a fractional part. This is what I have so far: import java.util.*; public class largesttoSmallest { public static void main(String[] args) { //* Tosca J. Hudson//* System.out.println("Enter some nonnegative intergers."); System.out.println("Enter a negative interger after you have."); System.out.println("entered the nonnegative intergers."); int largest = 0; int smallest = 0; double largest, smallest, average; Scanner keyboard = new Scanner(System.in); number = keyboard.nextInt( ); while (integer variable is >= 0); { System.out.println(); } System.out.println( ); System.out.println(); } }
ASKED: December 7, 2007  4:50 PM
UPDATED: January 7, 2008  3:36 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Have you got the answer to your question?

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following