Challenge Hints: For Loops Continued

A list of hints for the challenges in the For Loops Continued lesson.

Last updated - July 23, 2024

 

Checkpoint

Did you name the variables correctly?

Did you name the variable "order"?

Check your for loop syntax.

Make sure you include a condition for the if and an else afterward.

Did you set the variable equal to "prompt()" with a question inside?

The Zoo

Did you get the number of animals that the user plans on visiting at the zoo?

Did you declare a for loop that will go over each animal?

For each animal, did you ask the user specifically what they plan on seeing?

Did you check if it is the last animal they are supposed to visit?

Otherwise, did you alert the user to continue enjoying the zoo?

Swimming Laps

Did you prompt the user for the number of laps that they would like to swim?

Did you create a for loop for each lap that will be swam?

For each lap, did you prompt the user if they are tired yet?

If the user responded they were tired, did you alert them to take a break?

Otherwise, did you alert them to keep going?

Did you alert the user congratulations on completing the workout?

The Lunch Line

Did you get the number of people waiting in line for lunch from the user?

Did you declare a for loop to iterate through each person in line for lunch?

If it was the very person in line, did you alert them to go take their order?

Otherwise, did you alert the user of how many minutes they need to wait?

Did you alert the user that lunch is now finished once all orders are complete?

Mystery Winner

Did you get the number of students in the class?

Did you divide the number of students by 7 and then add 2 to it?

For each student, check if it is the number student that is supposed to be the winner?

Otherwise, did you wish them better luck next time?

For more help with JavaScript, check out our JavaScript Reference Guide!