-7

Few Java questions:

  1. How to prompt user for input?
  2. How to save input from user in an array?
  3. How to average numbers in an array?
  4. How to compare numbers?
  5. How to print information back to the user?

The scenario is as follows: let the user to input 10 numbers into an array. Then loop through the array and average it. Then loop through the array again and compare each value against the average and print the number (and/or loop index) if it is lower than the average of the 10 numbers user entered.

KingsInnerSoul
  • 1,373
  • 4
  • 20
  • 49
  • 2
    Please do not shout! – Werner Kvalem Vesterås Aug 20 '15 at 13:21
  • 2
    Also don't mention, I need ASAP, Urgently etc. It's irrelevant to us, please show us what have you tried? People never gonna write a code for you here. – Pradeep Simha Aug 20 '15 at 13:22
  • 1
    [Stack Overflow is not a code writing service](http://meta.programmers.stackexchange.com/questions/6166/open-letter-to-students-with-homework-problems). Perhaps you could start by reading through [this tutorial](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html)? – PakkuDon Aug 20 '15 at 13:22
  • 1
    Hey Alexis, great to have you here, welcome to the community. Your question is likely to be closed because it is too broad and not properly formatted. Please see this article on how to ask a question: http://stackoverflow.com/help/how-to-ask – Rick Hanlon II Aug 20 '15 at 13:22
  • What have you tried so far? What code would you need to let the user input a single number? How could you use a loop to input 10 numbers? How could you put each of the numbers entered by the user into slots in an array? What steps do you need to take to find the average of 10 numbers? How do you check whether a number is lower than another number? – GreenGiant Aug 20 '15 at 13:26

1 Answers1

5
Read the array.

Calculate the average.

Loop through the array
   check if it has value less than average
        if yes print the index
   if no check for the next
Uma Kanth
  • 5,659
  • 2
  • 20
  • 41