1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>HW2</title>
- </head>
- <body>
- <script>
- //assign: evaluation
- var a = 5;
- var b, c;
- b = c = ((a * 5)/2);
- // Number: age
- {
- let year = prompt ("Введите ваш возраст", "");
- let thisYear = 2022;
- alert(thisYear - year + " год рождения");
- }
- // Number: temperature
- {
- let temperatureCelsium = prompt ("Бро какава температура в °C", "")
- let changeTemperature = temperatureCelsium * 1.8 + 32;
- alert(changeTemperature + " °F")
- }
- // Number: divide
- {
- let firstNumber = prompt (" Введите первое число", "");
- let secondNumber = prompt (" Введите второе число","");
- let resultat = Math.floor (firstNumber / secondNumber);
- alert(resultat);
- }
- // Number: odd
- {
- let number = prompt("Введите число:");
- if (number = Number(number)) {
- true;
- }
- else {
- alert("Введите число!");
- }
- }
- // String: greeting
- {
- let name = prompt("what is your name?", "");
- alert("Hi " + name)
- }
- // confirm
- {
- let human = confirm("you are human?");
- alert(human);
- }
- //Boolean: if
- {
- let human = confirm("you are human?");
- if(human) {
- alert("You are a woman?");
- }
- else {
- alert("You are a man");
- }
- }
- </script>
- </body>
- </html>
|