Lesson 5: Arrays Homework

Coding the first correct answer used in the video explanation gives an error:

if (quizScore < 70) {
System.out.println(“You should reach out to the course staff”);
} else if (quizScore >= 70 && quizScore <= 90) {
System.out.println(“Nice job, and you can probably do better next time”);
} else {
System.out.println(“Great job”);
}

The homework rates it as incorrect stating:
Your submission contains unexecuted code:
You have 1 more lines of unexecuted code than the solution, which is more than the limit of 0…

Hey Candace,

When I completed this homework assignment, I completely dropped the

quizScore >= 70

because the very first if statement ensures that any quizScore that reaches the else if condition will be greater than or equal to 70. For this reason, this check is completely unnecessary.

Hopefully this helps!

2 Likes