Week1Mock1MCQ25

Run Settings
LanguageJava
Language Version
Run Command
public class Main { public static void main(String[] args) { // Harbor, Week 1, Mock 1, PR_PracticeTest_1.pdf // AP CS A // MCQ 25 int sales[] = {5, 6, 9, 9, 10, 10, 11}; int i = 0; int sum = 0; for (int element : sales) { sum += element; // sum += sales[element]; } double avg = (double) sum/sales.length; System.out.println(avg); // Output: 8.571428571428571 } }
Editor Settings
Theme
Key bindings
Full width
Lines