Created
August 21, 2017 21:18
-
-
Save claudiainbytes/229d05241042c6c0affd3d5ab5360590 to your computer and use it in GitHub Desktop.
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
/* | |
* Programming Quiz: JuliaJames (4-1) | |
*/ | |
var x = 1; | |
while ( x <= 20) { | |
// check divisibility | |
if(( x % 3 === 0 ) && ( x % 5 === 0)){ | |
console.log("JuliaJames"); | |
}else if ( x % 3 === 0) { | |
console.log("Julia"); | |
} else if ( x % 5 === 0){ | |
console.log("James"); | |
} else { | |
console.log(x); | |
} | |
x++; | |
// print Julia, James, or JuliaJames | |
// increment x | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment