123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- let inthisYear = prompt("was there a birthday this year?");
- let yourAge;
- let yearOfBirth = +prompt("enter your year of birth");
- if (inthisYear === "yes") {
- yourAge = 2020 - yearOfBirth;
- } else if (inthisYear === "no") {
- yourAge = 2019 - yearOfBirth;
- }
- alert("Your age:" + yourAge);
- let temperatureCelsius = +prompt("temperature degrees Celsius");
- let temperatureFahrenheit = temperatureCelsius * 1.8 + 32;
- alert(temperatureFahrenheit);
- let numerator = +prompt("enter the numerator");
- let denomerator = +prompt("enter the denominator");
- alert(Math.floor(numerator / denomerator));
- let enterNum = +prompt("Enter the number");
- if (enterNum == typeof (Number)) {
- if (enterNum % 2 === 0) {
- alert("число четное");
- } else {
- alert("число нечетное");
- }
- } else {
- alert("Вам нужно ввести число");
- }
- let name = prompt("Enter your name");
- alert(`Hey, ${name}!`);
- alert("Hey," + name + "!" + " How are you?")
- let confirm = confirm(Yes / No)
- console.log(confirm)
- if (confirm == true) {
- alert("Yes");
- if (confirm == false) {
- alert("No")
- }
- }
- let allRight = confirm(" Are you all right ?")
- let readBooks = confirm("Do you read books?")
- let studyMath = confirm("Do you study math?")
- let allRight = confirm(" Are you all right ?")
- if (allRight === true) {
- alert("All is cool)")
- } else {
- alert("You are bad//")
- }
- let readBooks = confirm("Do you read books?");
- if (readBooks === true) {
- alert("All is cool")
- } else {
- alert("Read books!")
- }
- let studyMath = confirm("Do you study math?")
- if (studyMath === true) {
- alert("Help me please")
- } else {
- alert("I also")
- }
- let array = []
- array[0] = allRight
- array[1] = readBooks
- array[2] = studyMath
- alert(array)
- let object = {
- name: "Sneakers",
- firm: "Adidas",
- model: "Falcon",
- color: "Blue",
- size: "24cm",
- }
- object.year = 2018;
- object.color = "black";
- object["size"] = 23;
- object
- var age = +prompt("Сколько вам лет?", "");
- if (age < 0) {
- alert("Такого не бывает")
- } else if (age <= 18) {
- alert("школьник");
- } else if (age >= 18 && age <= 30) {
- alert("молодеж");
- } else if (age >= 30 && age <= 45) {
- alert("зрелость");
- } else if (age >= 45 && age <= 60) {
- alert("закат");
- } else if (age >= 60) {
- alert("как пенсия?");
- } else {
- alert("то ли киборг, то ли ошибка");
- }
- let size = +prompt("Your outerwear size?(40,42,44,46,48,50,52,54)");
- let sizeUSA
- if (size === 40) {
- sizeUSA = 6
- alert(`Your size to US system: ${sizeUSA}!`)
- } else if (size === 42) {
- sizeUSA = 8
- alert(`Your size to US system: ${sizeUSA}!`)
- } else if (size === 44) {
- sizeUSA = 10
- alert(`Your size to US system: ${sizeUSA}!`)
- } else if (size === 46) {
- sizeUSA = 12
- alert(`Your size to US system: ${sizeUSA}!`)
- } else if (size === 48) {
- sizeUSA = 14
- alert(`Your size to US system: ${sizeUSA}!`)
- } else if (size === 50) {
- sizeUSA = 16
- alert(`Your size to US system: ${sizeUSA}!`)
- } else if (size === 52) {
- sizeUSA = 18
- alert(`Your size to US system: ${sizeUSA}!`)
- } else if (size === 54) {
- sizeUSA = 20
- alert(`Your size to US system: ${sizeUSA}!`)
- } else {
- alert("Error")
- }
- let gender = confirm("Your are male?");
- let result = (gender == true) ? alert("Your are a man") : alert("Your are a woman");
|