-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask4.html
86 lines (61 loc) · 2.67 KB
/
task4.html
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<img src="Q4.JPG" alt="Q4"><br><br>
<select name="" id="gender">
<option value="" selected disabled>Select Gender</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
</select><br><br>
<input type="text" placeholder="Enter year of service" id="year of service"><br><br>
<select name="" id="qualification">
<option value="" selected disabled>Select Qualification</option>
<option value="Graduate">Graduate</option>
<option value="Post Graduate">Post Graduate</option>
</select>
<button onclick="myFunction()">CHECK</button>
<script>
function myFunction() {
var gender = document.getElementById('gender').value;
var service = document.getElementById('year of service').value;
var qualification = document.getElementById('qualification').value;
var year_of_service = 2020 - service;
alert(salary(gender,year_of_service,qualification));
}
function salary(gender,year_of_service,qualification) {
if (gender == 'Male' && year_of_service >= 10 && qualification == 'Post Graduate') {
return ('Your salary is 15000')
}
else if (gender == 'Male' && year_of_service >= 10 && qualification == 'Graduate') {
return ('Your salary is 10000')
}
else if (gender == 'Male' && year_of_service < 10 && qualification == 'Post Graduate') {
return ('Your salary is 10000')
}
else if (gender == 'Male' && year_of_service < 10 && qualification == 'Graduate') {
return ('Your salary is 7000')
}
else if (gender == 'Female' && year_of_service >= 10 && qualification == 'Post Graduate') {
return ('Your salary is 12000')
}
else if (gender == 'Female' && year_of_service >= 10 && qualification == 'Graduate') {
return ('Your salary is 9000')
}
else if (gender == 'Female' && year_of_service < 10 && qualification == 'Post Graduate') {
return ('Your salary is 10000')
}
else if (gender == 'Female' && year_of_service < 10 && qualification == 'Graduate') {
return ('Your salary is 6000')
}
else {
return ('You are not registerd. Check your values')
}
}
</script>
</body>
</html>