forEach: Count Passing Scores
easyQuestion 36Use forEach and an if statement to count how many scores are 60 or higher, then print the count.
Array: [55, 78, 90, 62, 48]
Steps: 1. Create a variable passingCount set to 0 2. Use forEach to check each score 3. If score is at least 60, increase passingCount 4. Print the final count
Expected output
Passing count: 3= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
LoopsArraysforEach
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (clog, fn, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.