Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. public class RainFall
  2. {
  3. private double[] rain;
  4. /*
  5. public RainData(double[] r)
  6. {
  7. rain = new double[r.length];
  8.  
  9. for (int index = 0; index <r.length; index++)
  10. rain[index] = r[index];
  11. }
  12. */
  13. public static double getTotal()
  14. {
  15. double total = 0.0;
  16.  
  17. for (int index = 0; index < rain.length; index++)
  18. total += rain[index];
  19.  
  20. return total;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement