-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path[Switch] Back to School (3-9)
51 lines (42 loc) · 1.25 KB
/
[Switch] Back to School (3-9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Programming Quiz: Back to School (3-9)
*
* Write a switch statement to set the average salary of a person based on their type of completed education.
*
*/
/*
* QUIZ REQUIREMENTS
* - Your code should have the variables `education`, and `salary`
* - Your code should include a switch statement
* - Your code should produce the expected output
* - Your code should not be empty
* - BE CAREFUL ABOUT THE PUNCTUATION AND THE EXACT WORDS TO BE PRINTED.
*/
// 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;
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.');