A Pen by ClaudiaInBytes on CodePen.
Created
August 20, 2017 20:49
-
-
Save claudiainbytes/2d0a0f3a3cefea0a86cb4a2ceca03553 to your computer and use it in GitHub Desktop.
Education and Salary in US - Switch Statement
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: Back to School (3-9) | |
*/ | |
// change the value of `education` to test your code | |
var education = "no high school diploma"; | |
// set the value of this based on a person's education | |
var salary; | |
// your code goes here | |
switch(education){ | |
case "no high school diploma": | |
salary = 25636; | |
break; | |
case "a high school diploma": | |
salary = 35256; | |
break; | |
case "an Associate's degree": | |
salary = 41496; | |
break; | |
case "a Bachelor's degree": | |
salary = 59124; | |
break; | |
case "a Master's degree": | |
salary = 69732; | |
break; | |
case "a Professional degree": | |
salary = 89960; | |
break; | |
case "a Doctoral degree": | |
salary = 84396; | |
break; | |
} | |
console.log("In 2015, a person with " + education + " earned an average of $" + salary.toLocaleString("en-US") + "/year.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment