Advertisement
Gauge1417

Untitled

Mar 9th, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public class Program {
  2.  
  3. public static void main(String[] args) {
  4. double [] scores = {4.7, 4.6, 4.7, 5.0, 4.3, 5.0, 4.9};
  5.  
  6.  
  7. double array = scores.length;
  8. int i = 0;
  9. double sum = 0;
  10. while(i < array) {
  11. sum = sum + scores[i];
  12. i = i + 1;
  13.  
  14. }
  15.  
  16. System.out.println("The average score for this skater is " + sum / scores.length);
  17.  
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement