//Homework 2
function multiply(x,y){
return (x*y);
}
let f =prompt('please enter tempurture');
let m = multiply(f , 1.8);
console.log(m);
//homework 3
let f =prompt('please enter number')
if (f >= 0 )
console.log('positive')
else {
console.log('negative');}
//home work 4 not solve :(
let word= prompt('please enter the sentence');
let num = prompt('please enter the number');
if (num <= 0)
console.log('false');
else( num>0 );{
for (i=0 ; i < num ; i++){
for (k=0 ; k < i ; k++){
console.log(word);
}
}
}
//home work 5
function i (arry, num){
num = prompt('plese enter number');
for (let item of arry) {
if (item === num)
console.log(num);
}
return false;
}
i ([5,6,3,2,7]) ;
homework 6 there is function we didn't sudy it
//home work 7
let num = prompt('plese enter number');
for (i=1 ; i <= num ; i++){
f = i+i;
}
console.log (f);
homework 8 there is function we didn't sudy it
//homework 1
for (i=1; i<= 10 ; i++){
console.log (i*i);
}
//homework 2
for (i=1; i<= 10 ; i++){
console.log (i*5);}
//homework 3 not know
//homework 4
let age = prompt('please enter your age');
if (age <=10)
console.log ('you are kid ');
else if (age <=18)
console.log ('you are big kid ');
else if (age <=30)
console.log ('you are young ');
else
console.log ('you are old ');
//home work 5
let weight = prompt ('please enter your weight');
let length = prompt ('please enter your length');
let BMI = ((weight / (length*length) ) * 10000 );
console.log(BMI);
if (BMI <=18.5)
console.log ('Weight loss');
else if (BMI <=25)
console.log ('Weight normal');
else if (BMI <=40)
console.log ('Weight extra');
else
console.log ('you need to see doctor');
//home work 6 مااعرف اطلب سلسة من الارقام
//home work 7
let num1 = prompt ('please enter number 1');
let num2 = prompt ('please enter number 2');
if (num1 % num2 ===0)
console.log(num1/num2,true);
else
console.log(false);
هذي اللي قدرت احله واللي مااعرفت كتبت عندها ممكن احد يشيك اذا حلي صح او لا ويساعدني احل التمارين اللي ماعرفتها
وشكرا على سرعة استجابتكم