'F' → Fullscreen
count. console.log("--- Demo 1: Task Counter ---");
// Starter task listlet tasks = [ "Finish math homework", "Practice arrays", "Pack gym clothes", "Email coach"];
// Use traversal to COUNT how many tasks existlet count = 0;let i = 0;
while (i < tasks.length) { count++; i++;}
// Print the resultconsole.log("You have " + count + " tasks to complete.");
prompt("Press enter to continue...");console.log("--- Demo 2: Score Analyzer ---");
// Starter datalet scores = [72, 85, 90, 66, 88];
// Step 1: Calculate the TOTAL of all scoreslet total = 0;let i = 0;
while (i < scores.length) { total += scores[i]; i++;}
// Step 2: Calculate the AVERAGE scorelet average = total / scores.length;
// Step 3: Print resultsconsole.log("Total score:", total);console.log("Average score:", average);
// Step 4: Print a message based on the averageif (average >= 70) { console.log("Class average is passing.");} else { console.log("Class average is not passing.");}
prompt("Press enter to continue...");Your program output should something similar to the sample output below.
--- Demo 1: Task Counter ---You have 4 tasks to complete.Press enter to continue... [Enter]
--- Demo 2: Score Analyzer ---Total score: 401Average score: 80.2Class average is passing.Press enter to continue... [Enter]You may write your reflection answers as comments at the bottom of your code.
array.length when calculating an average?Submit your activity and reflection answers to the appropriate dropbox.