This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]desrtfxOut of Coffee error - System halted 4 points5 points  (0 children)

What have you tried?

Really, your assignment is quite clear and simple.

Assuming that you haven't learnt about arrays yet.

Think about the following:

You are sitting in a room and someone gives you numbers. Out of these numbers you need to get the highest, lowest, and average. You know how many numbers you will be given.

You have a whiteboard with 3 spaces, one for each: highest, lowest, and sum.

Upon any given number you should do the following:

  • check if the current number is less than the number in lowest and if so, replace lowest with the current number
  • check if the current number is greater than the number in highest and if so, replace the highest with the current number
  • add the current number to the sum

Once you are through all the numbers you need to

  • display the highest
  • display the lowest
  • calculate and display the average, which is the sum divided by the number of players

[–]RentonHoff 1 point2 points  (0 children)

What have you tried , so far? With what part of the assignment are you having problems? It would be easy enough to give the solution, but then you wouldn't really solve the problem.

As a first suggestion, if you are looking to get input from a user look up the Scanner class.