Browse Source

HW<3> done

Illia Kozyr 2 years ago
parent
commit
b99edad098
3 changed files with 32 additions and 6 deletions
  1. 1 2
      HW 1/index.html
  2. 4 4
      HW 3/index.html
  3. 27 0
      HW 3/ingtrb.html

+ 1 - 2
HW 1/index.html

@@ -8,8 +8,7 @@
     </head>
     <body>
         <script>
-            
-            
+        
             let CaloriesPerDay = 2000;
             let CaloriesPerMeal = prompt(
                 "Введите, сколько калорий вы потребили:"

+ 4 - 4
HW 3/index.html

@@ -160,17 +160,17 @@
             let userName3 = prompt("Введите ваше имя");
             let userSurname3 = prompt("Введите вашу фамилию");
             let userPatronymic3 = prompt("Введите ваше отчество");
-            if (userName3 == null || "") {
+            if (userName3 == null || " ") {
                 userName3 = "Иван";
             }
-            if (userSurname3 == null || "") {
+            if (userSurname3 == null || " ") {
                 userSurname3 = "Иванов";
             }
-            if (userPatronymic3 == null || "") {
+            if (userPatronymic3 == null || " ") {
                 userPatronymic3 = "Иванович";
             }
 
-            alert(userSurname + " " + userName + " " + userPatronymic);
+            alert(userSurname3 + " " + userName3 + " " + userPatronymic3);
             break;
             case "login and password" : 
             let login = prompt("Введите логин");

+ 27 - 0
HW 3/ingtrb.html

@@ -0,0 +1,27 @@
+<!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>Document</title>
+</head>
+<body>
+    <script>
+            let userName3 = prompt("Введите ваше имя");
+            let userSurname3 = prompt("Введите вашу фамилию");
+            let userPatronymic3 = prompt("Введите ваше отчество");
+            if (userName3 == null || " ") {
+                userName3 = "Иван";
+            }
+            if (userSurname3 == null || " ") {
+                userSurname3 = "Иванов";
+            }
+            if (userPatronymic3 == null || " ") {
+                userPatronymic3 = "Иванович";
+            }
+
+            alert(userSurname3 + " " + userName3 + " " + userPatronymic3);
+    </script>
+</body>
+</html>