Browse Source

HW<1.1> done

Прохор Антропов 2 years ago
parent
commit
371bca8656
2 changed files with 27 additions and 0 deletions
  1. 13 0
      index.html
  2. 14 0
      js/myjs.js

+ 13 - 0
index.html

@@ -0,0 +1,13 @@
+<!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>
+    <h1 style="text-align: center;">СКОЛЬКО ТРАЧУ НА СОБАКУ В МЕСЯЦ!</h1>
+    <script src='js/myjs.js'></script>
+</body>
+</html

+ 14 - 0
js/myjs.js

@@ -0,0 +1,14 @@
+let StoimostDenPitaniya;
+let Utro;
+let Vecher;
+let DopTrati;
+let Month;
+
+do{                                                
+	let Utro = prompt("Скольоко потратили утром","");
+    let Vecher = prompt("Сколько потратили вечером.","");
+    let DopTrati = prompt("Дополнительные рассходы.",""); 
+	StoimostDenPitaniya  = +Utro + +Vecher + +DopTrati;
+    Month = StoimostDenPitaniya * 30;
+	alert("Траты за день: " + StoimostDenPitaniya +"\n" + "Траты в месяц: " + Month);                       
+}while(Month && StoimostDenPitaniya !== null)