Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Program {
- public static void main(String[] args) {
- double [] scores = {4.7, 4.6, 4.7, 5.0, 4.3, 5.0, 4.9};
- double array = scores.length;
- int i = 0;
- double sum = 0;
- while(i < array) {
- sum = sum + scores[i];
- i = i + 1;
- }
- System.out.println("The average score for this skater is " + sum / scores.length);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement