Skip to content

Instantly share code, notes, and snippets.

@desinas
Last active June 5, 2018 09:09
Show Gist options
  • Save desinas/21d44be851d49f5cb9c29acf2717a9a6 to your computer and use it in GitHub Desktop.
Save desinas/21d44be851d49f5cb9c29acf2717a9a6 to your computer and use it in GitHub Desktop.
Countdown Liftoff quiz of Udacity Front end dev
/*
* Programming Quiz: Countdown, Liftoff! (4-3)
*
* Using a while loop, print out the countdown output above.
*/
// your code goes here
timeInSeconds =60;
while (timeInSeconds >= 0) {
if (timeInSeconds === 50) {
console.log("Orbiter transfers from ground to internal power")
}
else if (timeInSeconds === 31) {
console.log("Ground launch sequencer is go for auto sequence start")
}
else if (timeInSeconds === 16) {
console.log("Activate launch pad sound suppression system")
}
else if (timeInSeconds === 10) {
console.log("Activate main engine hydrogen burnoff system")
}
else if (timeInSeconds === 6) {
console.log("Main engine start")
}
else if (timeInSeconds === 0) {
console.log("Solid rocket booster ignition and liftoff!")
}
else console.log("T-" + timeInSeconds + " seconds");
timeInSeconds -=1;
}
@desinas
Copy link
Author

desinas commented Dec 16, 2017

What Went Well

  • Your code should include a while loop
  • Your while loop should have a stop condition
  • Your code should produce the expected output

Feedback: Your answer passed all our tests! Awesome job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment