Skip to content

Instantly share code, notes, and snippets.

@claudiainbytes
Created August 22, 2017 03:39
Show Gist options
  • Select an option

  • Save claudiainbytes/4d35548733875ffba455b5dfebd0212d to your computer and use it in GitHub Desktop.

Select an option

Save claudiainbytes/4d35548733875ffba455b5dfebd0212d to your computer and use it in GitHub Desktop.
/*
* Programming Quiz: Countdown, Liftoff! (4-3)
*
* Using a while loop, print out the countdown output above.
*/
// your code goes here
var seconds = 60;
while ( seconds > -1 ) {
if ( seconds === 50 ) {
console.log("Orbiter transfers from ground to internal power");
} else if ( seconds === 31 ) {
console.log("Ground launch sequencer is go for auto sequence start");
} else if ( seconds === 16 ) {
console.log("Activate launch pad sound suppression system");
} else if ( seconds === 10 ) {
console.log("Activate main engine hydrogen burnoff system");
} else if ( seconds === 6 ) {
console.log("Main engine start");
} else if ( seconds === 0 ) {
console.log("Solid rocket booster ignition and liftoff!");
} else {
console.log("T-" + seconds + " seconds");
}
seconds--;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment