-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathifelse.js
More file actions
36 lines (34 loc) · 994 Bytes
/
ifelse.js
File metadata and controls
36 lines (34 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const age = 15;
const isOldEnogh = age >= 18;
if (isOldEnogh) {
console.log("You are old enough to have fun");
} else {
const yearsLeft = 18 - age;
console.log(
`You are not an adult! you have ${yearsLeft} year ahead to have fun`
);
}
/************************* */
let birthYear = 1997;
let century;
if (birthYear <= 2000) {
century = 20;
} else {
century = 21;
}
let statment = `You are born in the ${century}th century`;
console.log(statment);
/*************************/
const akeleHight = 1.7;
const akeleWeight = 61;
const akele = ((akeleWeight) / (akeleHight ** 2)).toFixed(3);
const getachewHight = 1.8;
const getachewWeight = 63;
const getachew = ((getachewWeight )/ (getachewHight ** 2)).toFixed(3);
if(akele>getachew){
let akeleBmi = `Akele's BMi(${akele}) is greater than Getachew's BMI(${getachew}!)`
console.log(akeleBmi);
}else{
let getachewBmi = `Getachew's's BMi(${getachew}) is greater than Akele's BMI(${akele}!)`
console.log(getachewBmi);
}