소스 검색

veriable names changes in homework02

Daria 4 년 전
부모
커밋
17d59800c0
1개의 변경된 파일17개의 추가작업 그리고 16개의 파일을 삭제
  1. 17 16
      js-homework2/index.js

+ 17 - 16
js-homework2/index.js

@@ -1,26 +1,27 @@
-// let a = +prompt("enter your year of birth")
-// let b = 2020-a
-// alert("Your age:"+b) 
+let yearOfBirth = +prompt("enter your year of birth");
+let yourAge = 2020-yearOfBirth;
+alert("Your age:"+yourAge);
 
 
+let temperatureCelsius = +prompt("temperature degrees Celsius");
+let temperatureFahrenheit = temperatureCelsius * 1.8 + 32;
+alert(temperatureFahrenheit);
 
-// let t = +prompt("temperature in degrees Celsius")
-// let T = t*1.8+32
-// alert(T)
 
-// let x=+prompt("enter the numerator")
-// let y=+prompt("enter the denominator")
-// alert(Math.floor(x/y))
+let numerator= +prompt("enter the numerator");
+let denomerator= +prompt("enter the denominator");
+alert(Math.floor(numerator/denomerator));
 
 
-// let n=+prompt("enter the namber");
-// if(n % 2==0){
-// alert("число четное");
-// }else{
-// alert("число нечетное")
-// }
+let number= +prompt("enter the number");
+if(number % 2==0){
+alert("число четное");
+}else{
+alert("число нечетное");
+};
 
-// let name = prompt("Enter your name")
+let name = prompt("Enter your name");
+alert(`Hey, ${name}!`);
 // alert("Hey,"+name+"!"+" How are you?")