Here is the challenge. I need to use the Android project. The array stores information about the amount of precipitation that fell on every day of February. Determine the average daily rainfall this month.

I understand how to solve it logically (you need to add all the numbers in the array and divide by the size of the array) but write the code does not work because I do not remember all the operators

Can you remind me of the operators for this task?

Thank you in advance!

Closed due to the fact that off-topic participants Vladyslav Matviienko , Max Mikheyenko , Vladimir Glinskikh , Aries , Vladimir Martyanov 17 Oct '15 at 7:29 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • " Questionnaires are forbidden on Stack Overflow in Russian . To get an answer, rephrase your question so that it can be given an unambiguously correct answer." - Vladyslav Matviienko, Max Mikheyenko, Vladimir Glinskikh, Aries, Vladimir Martyanov
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 2
    1. Write a normal title. The fact that you need to solve some problem is known by default, because on another occasion you would not ask a question. 2. What exactly is causing you difficulty? Or do you want someone to do your work for you? - Vladyslav Matviienko
  • one
    The operators are: = - assignment, + - addition, / - division. But seriously, this is written in any serious java manual. - Dmitriy Simushev
  • If you have specific implementation questions, you will always get an answer. And if the whole question comes down to "write for me", then alas. - Dmitriy Simushev
  • Operators in the Java language are: arithmetic, bitwise, logical. Work The solution has already been written to you by @Dmitriy Simushev. - Vladimir Glinskikh

1 answer 1

The algorithm for solving the problem is as follows:

  1. To bypass an array, summing all its values ​​into a variable
  2. Find the number of elements in the array
  3. Divide the value obtained in item 1 by the value from item 2.

I will not write the code in principle, since the task is clearly educational and should be solved by you yourself.