Skip to content

Instantly share code, notes, and snippets.

@desinas
Last active September 19, 2023 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save desinas/8bb13512d96ffc4c1b8c38e42d44e682 to your computer and use it in GitHub Desktop.
Save desinas/8bb13512d96ffc4c1b8c38e42d44e682 to your computer and use it in GitHub Desktop.
Back to school Quiz (3-9) from Udacity Frond end developer
/*
* 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;
}
console.log("In 2015, a person with " + education
+ " earned an average of $" + salary.toLocaleString("en-US") + "/year.");
@desinas
Copy link
Author

desinas commented Dec 16, 2017

Revision 2 What Went Well

  • Your code should have a variable education
  • Your code should have a variable salary

What Went Wrong

  • Your code is missing a switch statement
  • Cannot read property '0' of null

Feedback: Not everything is correct yet, but you're close!

@desinas
Copy link
Author

desinas commented Dec 16, 2017

Revision 3 What Went Well

  • Your code should have a variable education
  • Your code should have a variable salary
  • Your code should include a switch statement
  • Your code should produce the expected output

Feedback: Your answer passed all our tests! Awesome job!

@neethajainb
Copy link

 /*
 * 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 = 0;
// 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.");

 
           

@jasicarose75
Copy link

jasicarose75 commented Jul 26, 2023

I have always loved quizzes and am looking forward to this new opportunity to test my knowledge. I took prizes in the stake. I even looked for assignment help to learn, used https://edubirdie.com/assignment-help for this. Also, as a front-end developer, I'm currently working on creating fun quizzes in react for colleges. This is not easy as it may seem at first glance. I hope that my work will help students to learn and study with pleasure.

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