|
@@ -0,0 +1,375 @@
|
|
|
+<!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>
|
|
|
+
|
|
|
+ //ASSIGN: EVALUATION
|
|
|
+
|
|
|
+
|
|
|
+ // var a = (5);
|
|
|
+ // var b, c;
|
|
|
+
|
|
|
+ // b = ((a) * (5));
|
|
|
+ // b = ((c) = ((b)/(2)));
|
|
|
+
|
|
|
+
|
|
|
+ // 1- (5); 2 - ((a) * (5)); 3 - ((b)/(2)); 4- (c)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //SEMICOLON: ERROR
|
|
|
+
|
|
|
+
|
|
|
+ // for(let i = 0 i<10; i++)
|
|
|
+ // let i let b
|
|
|
+
|
|
|
+
|
|
|
+ //SEMICOLON: MISTAKE
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //NUMBER: AGE
|
|
|
+
|
|
|
+ // let age = +prompt("how old are you?")
|
|
|
+
|
|
|
+ // if(age){
|
|
|
+ // if (age>0){
|
|
|
+ // alert(age)
|
|
|
+ // }
|
|
|
+ // else{
|
|
|
+ // alert("error")
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ //NUMBER: TEMPERATURE
|
|
|
+
|
|
|
+ // let temp = +prompt("Enter temperature to convert")
|
|
|
+ // let celsius = confirm("Іs the temperature in celsius degrees?")
|
|
|
+
|
|
|
+ // if(temp){
|
|
|
+ // if (celsius){
|
|
|
+ // alert((( temp * (9/5)) + 32).toFixed(1))
|
|
|
+ // }else{
|
|
|
+ // alert(((temp - 32) * (5/9)).toFixed(1) )
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //NUMBER: DIVIDE
|
|
|
+
|
|
|
+
|
|
|
+ // let num1 = +prompt("Enter dividend (default: 0)",0)
|
|
|
+ // let num2 = +prompt("Enter divider")
|
|
|
+
|
|
|
+
|
|
|
+ // if(!num1 || !num2){
|
|
|
+ // alert("error")
|
|
|
+ // }else{
|
|
|
+ // alert(Math.floor(num1/num2))
|
|
|
+
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //NUMBER: ODD
|
|
|
+
|
|
|
+ // let num = +prompt("Enter the number")
|
|
|
+
|
|
|
+ // if(num){
|
|
|
+ // if(num %2 == 0){
|
|
|
+ // alert("number is even")
|
|
|
+ // }else{
|
|
|
+ // alert("number is odd")
|
|
|
+ // }
|
|
|
+ // }else{
|
|
|
+ // alert("error: incorrect number")
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ //STRING: GREETING
|
|
|
+
|
|
|
+ // let name = prompt("Enter ur name")
|
|
|
+
|
|
|
+ // if(name){
|
|
|
+ // alert("Hello " + name)
|
|
|
+ // }else{
|
|
|
+ // alert("error")
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //STRING: LEXICS
|
|
|
+
|
|
|
+ // let incorrectText = "frontend is markup"
|
|
|
+
|
|
|
+ // let text = prompt("Enter text")
|
|
|
+
|
|
|
+ // if(text){
|
|
|
+ // text = text.toLowerCase()
|
|
|
+ // text.includes(incorrectText)?alert(true):alert(false)
|
|
|
+ // }else{
|
|
|
+ // alert("error")
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //CONFIRM
|
|
|
+
|
|
|
+
|
|
|
+ // let conf = confirm()
|
|
|
+
|
|
|
+ // //on "Yes"
|
|
|
+
|
|
|
+ // console.log(typeof conf)//boolean
|
|
|
+ // console.log(conf)//true
|
|
|
+
|
|
|
+ // // on "No"
|
|
|
+
|
|
|
+ // console.log(typeof conf)//boolean
|
|
|
+ // console.log(conf)//false
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //BOOLEAN
|
|
|
+
|
|
|
+ // let isStudent = confirm("Are you student?")
|
|
|
+ // let isBachelor = confirm("Do you have bachelor degree?")
|
|
|
+ // let isMaster = confirm("Do you have master degree?")
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //BOOLEAN: IF
|
|
|
+
|
|
|
+
|
|
|
+ // let isStudent,isBachelor,isMaster
|
|
|
+ // isStudent = confirm("Are you student?")
|
|
|
+
|
|
|
+ // if(isStudent){
|
|
|
+ // isBachelor = confirm("Do you have bachelor degree?")
|
|
|
+ // }else{
|
|
|
+ // isBachelor = confirm("Do you have bachelor degree?")
|
|
|
+
|
|
|
+ // if(isBachelor){
|
|
|
+ // isMaster = confirm("Do you have master degree?")
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ //ARRAY: REAL
|
|
|
+
|
|
|
+ //let myBackpack = ["laptop","laptop charger","mouse","pen","notebook","0.5 water"]
|
|
|
+
|
|
|
+
|
|
|
+ //ARRAY: BOOLEANS
|
|
|
+
|
|
|
+ // let isStudent = false
|
|
|
+ // let isBachelor = false
|
|
|
+ // let isMaster = false
|
|
|
+
|
|
|
+
|
|
|
+ // isStudent = confirm("Are you student?")
|
|
|
+
|
|
|
+ // if(isStudent){
|
|
|
+ // isBachelor = confirm("Do you have bachelor degree?")
|
|
|
+ // }else{
|
|
|
+ // isBachelor = confirm("Do you have bachelor degree?")
|
|
|
+
|
|
|
+ // if(isBachelor){
|
|
|
+ // isMaster = confirm("Do you have master degree?")
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ // let boolArray = [isStudent,isBachelor,isMaster]
|
|
|
+
|
|
|
+ //ARRAY: PLUS
|
|
|
+
|
|
|
+
|
|
|
+ // let arr = [5,2]
|
|
|
+
|
|
|
+ // arr[2] = arr.reduce((prev,curr)=>prev+curr)
|
|
|
+
|
|
|
+ // console.log(arr)
|
|
|
+
|
|
|
+
|
|
|
+ //ARRAY: PLUS STRING
|
|
|
+
|
|
|
+
|
|
|
+ // let arr = ["Hello ","World","!"]
|
|
|
+
|
|
|
+ // arr[3] = arr.reduce((prev,curr)=>prev+curr)
|
|
|
+
|
|
|
+ // console.log(arr)
|
|
|
+
|
|
|
+
|
|
|
+ //OBJECT: REAL
|
|
|
+
|
|
|
+ // let mouse = {
|
|
|
+ // color:"black",
|
|
|
+ // buttons:3,
|
|
|
+ // sizeX:5,
|
|
|
+ // sizeY:10,
|
|
|
+ // sizeZ:3.2
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ //OBJECT: CHANGE
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // let mouse = {
|
|
|
+ // color:"black",
|
|
|
+ // buttons:3,
|
|
|
+ // sizeX:5,
|
|
|
+ // sizeY:10,
|
|
|
+ // sizeZ:3.2
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ // mouse.color = "white"
|
|
|
+ // mouse["buttons"]=2
|
|
|
+ // console.log(mouse)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //COMPARISON IF
|
|
|
+
|
|
|
+
|
|
|
+ // var age = +prompt("Сколько вам лет?","");
|
|
|
+
|
|
|
+ // if(age<=0){
|
|
|
+ // alert("error: age cannot be smaller or equel 0")
|
|
|
+ // }else{
|
|
|
+ // if (age < 18){
|
|
|
+ // alert("школьник");
|
|
|
+ // }
|
|
|
+ // else{
|
|
|
+ // if ( age < 30){
|
|
|
+ // alert("молодеж");
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // if (age < 45){
|
|
|
+ // alert("зрелость");
|
|
|
+ // }
|
|
|
+ // else{
|
|
|
+ // if ( age <= 60){
|
|
|
+ // alert("закат");
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // if (age > 60){
|
|
|
+ // alert("как пенсия?");
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // alert("то ли киборг, то ли ошибка");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ //COMPARISON: SIZES
|
|
|
+
|
|
|
+ // let size = prompt("enter size to covert (Russia => USA )")
|
|
|
+
|
|
|
+ // if(size>=40 && size <=54){
|
|
|
+ // if(size>= 40 && size<42){
|
|
|
+ // alert("S")
|
|
|
+ // }
|
|
|
+ // if(size>= 42 && size<=44){
|
|
|
+ // alert("M")
|
|
|
+ // }
|
|
|
+ // if(size>= 46 && size<=48){
|
|
|
+ // alert("L")
|
|
|
+ // }
|
|
|
+ // if(size>= 50 && size<=52){
|
|
|
+ // alert("XL")
|
|
|
+ // }
|
|
|
+ // if(size === 54){
|
|
|
+ // alert("XXL")
|
|
|
+ // }
|
|
|
+ // }else {
|
|
|
+ // alert("error:incorrect size")
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ //COMPARISON: OBJECT
|
|
|
+
|
|
|
+ // let covertRussiaToUSA = {
|
|
|
+ // 40:"S",
|
|
|
+ // 42:"M",
|
|
|
+ // 44:"M",
|
|
|
+ // 46:"L",
|
|
|
+ // 48:"L",
|
|
|
+ // 50:"XL",
|
|
|
+ // 52:"XL",
|
|
|
+ // 54:"XXL",
|
|
|
+ // }
|
|
|
+
|
|
|
+ // let size = prompt("enter size to covert (Russia => USA )")
|
|
|
+
|
|
|
+ // if(size>=40 && size <=54 && size%2 ===0){
|
|
|
+ // alert(covertRussiaToUSA[size])
|
|
|
+ // }else {
|
|
|
+ // alert("error:incorrect size")
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ //TERNARY
|
|
|
+ //confirm("Are you male?")?alert("you are male"):alert("you are female")
|
|
|
+
|
|
|
+
|
|
|
+ //СИНИЙ ПОЯС NUMBER: FLATS
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // while(true){
|
|
|
+ // let floors = +prompt("Enter amount of floors")
|
|
|
+ // let flatsPerFloor = +prompt("Enter amount of flats per floor")
|
|
|
+ // let num = +prompt("Enter anumber of flat")
|
|
|
+
|
|
|
+ // if(!floors || floors<=0){
|
|
|
+ // alert('error:incorrect floors')
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if(!flatsPerFloor || flatsPerFloor<=0){
|
|
|
+ // alert('error:incorrect flats per floor')
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if(!num || num<=0){
|
|
|
+ // alert('error:incorrect num')
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+
|
|
|
+ // let enter = Math.ceil(num/(floors*flatsPerFloor))
|
|
|
+ // let floor = Math.ceil((num-((enter-1)*(floors*flatsPerFloor)))/flatsPerFloor )
|
|
|
+
|
|
|
+ // alert(`этаж:${floor} подъезд: ${enter}`)
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </script>
|
|
|
+ </body>
|
|
|
+</html>
|