This file contains 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 userChoice = prompt("Do you choose rock, paper or scissors?"); | |
var computerChoice = Math.random(); | |
if (computerChoice < 0.34) { | |
computerChoice = "rock"; | |
} else if(computerChoice <= 0.67) { | |
computerChoice = "paper"; | |
} else { | |
computerChoice = "scissors"; | |
} |
This file contains 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
// Write your function below. | |
// Don't forget to call your function! | |
var creditCheck = function(income) | |
{ if (income >= 100) { | |
return("You earn a lot of money! You qualify for a credit card"); | |
} else { | |
return("Alas you do not qualify for a credit card. Capitalism is cruel like that"); | |
} }; |