Created
February 22, 2018 20:24
-
-
Save chef-danny-d/c9d32e7166ec3f11cc37ad4883e61509 to your computer and use it in GitHub Desktop.
This snippet of code was taken from the Google Grow Scholarship on Udacity and it test the flowchart given to us.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var balance = 110000; | |
var checkBalance = true; | |
var isActive = true; | |
// your code goes here | |
if(checkBalance === true){ | |
if(isActive === true){ | |
if(isActive === true && balance < 0){ | |
console.log("Your account is negative") | |
} | |
else if(isActive === true && balance === 0){ | |
console.log("Your account is empty") | |
} | |
else{ | |
console.log("your balance is $" + balance.toFixed(2) + " and is active.") | |
} | |
} | |
else{ | |
console.log("Your account is not active.") | |
} | |
} | |
else{ | |
console.log("have a nice day") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Flowchart given