-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanketa_if.html
More file actions
37 lines (33 loc) · 971 Bytes
/
anketa_if.html
File metadata and controls
37 lines (33 loc) · 971 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Task2</title>
</head>
<body>
<script>
var surName = prompt('Введите Вашу фамилию:', '');
var name = prompt('Введите Ваше имя:', '');
var patronim = prompt('Введите Ваше отчество:', '');
var age = +prompt('Введите Ваш возраст в годах:');
var sex = confirm('Ваш пол - мужской?');
var pensionAge;
if( sex && age >= 60 || !sex && age >= 55) {
pensionAge = 'да';
} else {
pensionAge = 'нет';
}
if(sex) {
sex = 'мужской';
} else {
sex = 'женский';
}
var output = 'ФИО: ' + surName + ' ' + name + ' ' + patronim + '\n'
+ 'возраст, лет: ' + age + '\n'
+ 'возраст, дней: ' + age*365 + '\n'
+ 'пол: ' + sex + '\n'
+ 'пенсионный возраст: ' + pensionAge;
alert(output);
</script>
</body>
</html>