Skip to content

Instantly share code, notes, and snippets.

@chef-danny-d
Created February 22, 2018 20:24
Show Gist options
  • Save chef-danny-d/c9d32e7166ec3f11cc37ad4883e61509 to your computer and use it in GitHub Desktop.
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.
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")
}
@chef-danny-d
Copy link
Author

atm-check-balance-cropped
Flowchart given

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