'F' → Fullscreen
// Task 1 — "Class Score Snapshot" (Create + Access + .length)//// Goal: Use .length to safely access the last element and print a short report.
// Step 1: Create an array named 'scores' with at least 6 quiz scores.let scores = [84, 91, 76, 88, 95, 82];
// Step 2: Print how many scores are stored.console.log("Number of scores:", scores.length);
// Step 3: Create a variable named 'lastIndex' equal to the last valid index.let lastIndex = scores.length - 1;
// Step 4: Print the first and last score (do NOT hard-code the last index).console.log("First score:", scores[0]);console.log("Last score:", scores[lastIndex]);
// Step 5: Print ONE summary line exactly like this format:// We have X scores. First: A, Last: Bconsole.log("We have " + scores.length + " scores. First: " + scores[0] + ", Last: " + scores[lastIndex]);// Task 2 — "Score Fix + Pass Check" (Update + Decision)//// Scenario: The first and last scores were entered incorrectly.// - The first score should be 90// - The last score should be 87//// Step 1: Update the FIRST score to 90.scores[0] = 90;
// Step 2: Update the LAST score to 87 using lastIndex (do NOT hard-code).scores[lastIndex] = 87;
// Step 3: Print the updated scores array.console.log("Updated scores:", scores);
// Step 4: Print whether the LAST score is passing (70 or higher).// Print exactly ONE of these lines:// "Last score is passing."// "Last score is not passing."if (scores[lastIndex] >= 70) { console.log("Last score is passing.");} else { console.log("Last score is not passing.");}
// Step 5 (Optional Challenge):// Print: Last index is X (array length is Y).// Use lastIndex and scores.lengthYour program output should something similar to the sample output below.
Number of scores: 6First score: 84Last score: 82We have 6 scores. First: 84, Last: 82Updated scores: [90, 91, 76, 88, 95, 87]Last score is passing.You may write your reflection answers as comments at the bottom of your code.
Submit your activity and reflection answers to the appropriate dropbox.