// // first task------------------------------------------------------------------------------------------;
// // var a = 5;
// // var b, c;

// // b = a * 5;
// // b = c = b / 2;

// // Number:age------------------------------------------------------------------------------------------;

// // let yearOfBirth = prompt("Please, type year of your birth", 0000);

// // let currentYear = 2022;
// // let age = currentYear - yearOfBirth;

// // alert(age);

// // Number: temperature----------------------------------------------------------------------------------;

// // let temperatureCelsius = prompt(
// //   "Please, enter the temperature in degrees Celsius",
// //   0
// // );

// // let temperatureFahrenheit = temperatureCelsius * 1.8 + 32;

// // alert(temperatureFahrenheit);

// // Number: divide---------------------------------------------------------------------------------------;

// // let num1 = prompt("Enter first number", +0);
// // let num2 = prompt("Enter first number", +0);

// // let result = num1 / num2;

// // alert(Math.floor(result));

// // Number: odd------------------------------------------------------------------------------------------;

// let Number = +prompt("Enter any number");

// const result2 = Number % 2;
// if (isNaN(result2)) {
//   alert("Enter a number, please");
// } else {
//   if (result2 === 0) {
//     alert("even number");
//   }
//   if (result2 === 1) {
//     alert("odd number");
//   }
// }

// // String: greeting-------------------------------------------------------------------------------------;

// // let nameOfUser = prompt("What is your name?", 0);

// // alert(`You are welcome, ${nameOfUser}`);

// // String: lexics---------------------------------------------------------------------------------------;

// // let text = prompt("Enter any text here", []);

// // let message = "All is ok";
// // if (text.includes("fuck")) message = "Think about it";
// // alert(message);

// // Confirm-----------------------------------------------------------------------------------------------;

// // let opinion = confirm("Do you support this man?");

// // alert(opinion);

// // Boolean-----------------------------------------------------------------------------------------------;

// let answer = confirm("Are you eat breed for breakfast?");

// // alert(answer);

// let gender = confirm("Are you a woman?");

// // alert(gender);

// let tall = confirm("Are you taller then 180sm?");

// // alert(tall);

// // Boolean: if--------------------------------------------------------------------------------------------;

// let satiety = confirm("Did you eat anything for breakfast?");

// // if (satiety) {
// //   alert("it`s good you take care about your health");
// // } else {
// //   alert("Oh no, eat something now!!!");
// // }

// let passOnParty = confirm("Are you older than 18?");

// // if (passOnParty) {
// //   alert("You can passed");
// // } else {
// //   alert("You can not passed on party");
// // }

// let canBuy = confirm("Are you older than 18 years?");

// // if (canBuy) {
// //   alert("You can buy bottle of beer");
// // } else {
// //   alert("you are so young for it");
// // }

// // Array: real--------------------------------------------------------------------------------------------;

// let listForShop = ["milk, eggs, meet, water, flour, bread"];
// let ratingList = ["10, 12, 11, 10, 9, 11, 12"];
// let furniture = ["sofa, bed, chair, bedside table"];

// // Array: booleans----------------------------------------------------------------------------------------;

// let booleans = [answer, gender, tall, satiety, passOnParty, canBuy];

// // Array: plus--------------------------------------------------------------------------------------------;

// booleans[2] = booleans[0] + booleans[1];
// alert(booleans);

// // // Array: plus String-------------------------------------------------------------------------------------;
// // booleans["tall"] = booleans["answer"] + booleans["gender"];

// // alert(booleans);

// // Object: real-------------------------------------------------------------------------------------------;

// let myLaptop = {
//   brand: "Lenovo",
//   model: "Legion",
//   CPU: "AMD Ryzen",
//   GPU: "Nvidia GeForce 1650",
//   RAM: "16Gb",
// };

// let dreamCar = {
//   brand: "Mercedes-Benz",
//   model: "Viano",
//   length: "187 inch",
//   width: "75 inch",
//   height: "73.8 inch",
//   weight: "4497 lbs",
// };

// let myBook = {
//   color: "green",
//   weight: "550g",
//   length: "35cm",
//   width: "24cm",
// };

// alert(Object.entries(myNoteBook));

// alert(Object.entries(dreamCar));

// alert(Object.entries(myBook));

// // Object: change-----------------------------------------------------------------------------------------;

// myLaptop.RAM = "32 GB";
// myLaptop.brand = "Asus";
// myLaptop.model = "Zephirus";
// dreamCar.brand = "Suzuki";
// dreamCar.model = "Vitara";

// alert(Object.entries(myNoteBook));

// alert(Object.entries(dreamCar));

// alert(Object.entries(myBook));

// // Comparison if------------------------------------------------------------------------------------------;

// var age = +prompt("Сколько вам лет?", [""]);
// 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("то ли киборг, то ли KERNESS");
// }

// // Comparison: sizes--------------------------------------------------------------------------------------;

// let sizeOfDressUA = +prompt(
//   "Lets choose the right size for you. Enter your Ukrainian clothing size",
//   []
// );

// if (sizeOfDressUA === 38) {
//   alert("Your international size is XXS");
// } else if (sizeOfDressUA === 40) {
//   alert("Your international size is XS");
// } else if (sizeOfDressUA === 42) {
//   alert("Your international size is S");
// } else if (sizeOfDressUA === 44) {
//   alert("Your international size is M");
// } else if (sizeOfDressUA === 46) {
//   alert("Your international size is L");
// } else if (sizeOfDressUA === 48) {
//   alert("Your international size is XL");
// } else if (sizeOfDressUA === 50) {
//   alert("Your international size is XXL");
// } else if (sizeOfDressUA === 52) {
//   alert("Your international size is 3XL");
// } else {
//   alert("We do not know size of your dress");
// }
// // Comparison: object-------------------------------------------------------------------------------------;

// let user = {
//   sex: prompt("enter your gender", []),
//   bust: +prompt("enter bust measurment in cm", []),
//   hips: +prompt("enter hips measurment in cm", []),
//   waist: +prompt("enter waist measurment in cm", []),
// };

// if (
//   (user.sex === "woman", user.bust === 78, user.hips === 86, user.waist === 68)
// ) {
//   alert("Your international size is XXS");
// } else if (
//   (user.sex === "woman", user.bust === 82, user.hips === 90, user.waist === 62)
// ) {
//   alert("Your international size is XS");
// } else if (
//   (user.sex === "woman", user.bust === 86, user.hips === 94, user.waist === 66)
// ) {
//   alert("Your international size is S");
// } else if (
//   (user.sex === "woman", user.bust === 90, user.hips === 98, user.waist === 70)
// ) {
//   alert("Your international size is M");
// } else if (
//   (user.sex === "woman", user.bust === 94, user.hips === 102, user.waist === 74)
// ) {
//   alert("Your international size is L");
// } else if (
//   (user.sex === "woman", user.bust === 98, user.hips === 106, user.waist === 78)
// ) {
//   alert("Your international size is XL");
// } else if (
//   (user.sex === "woman",
//   user.bust === 102,
//   user.hips === 110,
//   user.waist === 82)
// ) {
//   alert("Your international size is XXL");
// } else {
//   alert("We could not determine your size, please contact customer service");
// }

// // Ternary------------------------------------------------------------------------------------------------;

// const gender = confirm("Are you a woman?");

// gender === true ? alert("You are a woman") : alert("You are a man");

// // Синий пояс Number: flats-------------------------------------------------------------------------------;

let numberOfFloors = prompt("how many floors in your house?", []);
let numberOfFlats = prompt("How many apartments per floor in your house?", []);
let yourApartmentNumber = prompt("Enter? please number of your apartment");

let numberOfApartmentsInTheEntrance = numberOfFloors * numberOfFlats;

let entranceNumber = Math.ceil(
  yourApartmentNumber / numberOfApartmentsInTheEntrance
);

let yourFloor = Math.ceil(
  (yourApartmentNumber -
    numberOfApartmentsInTheEntrance *
      Math.floor(yourApartmentNumber / numberOfApartmentsInTheEntrance)) /
    numberOfFlats
);

if (yourFloor === 0) {
  yourFloor += 1;
}

alert(
  `Your apartment is located in the ${entranceNumber} entrance, on the ${yourFloor} flor`
);
