misk-jsd2 / 03-conditionals-and-loops

0 stars 10 forks source link

Abdulkarim Alsaedi #25

Closed ajrfs closed 5 years ago

ajrfs commented 5 years ago

// bottles_of_coke for ( num = 99; num >= 0 ; num--){ if ( num > 2 ) { sentence1=[num ,"bottles of coke on the wall,", num ,"bottles of coke.",num-1 ,"bottles of coke on the wall"] console.log(sentence1.join(" ")) } else if ( num === 2 ) { sentence2=[num ,"bottles of coke on the wall,", num ,"bottles of coke.",num-1 ,"bottle of coke on the wall"] console.log(sentence2.join(" ")) }

else if ( num === 1 ){ 
    sentence3=[num,"bottle of coke on the wall",num,"bottle of coke. Take one down and pass it around, no more bottles of coke on the wall."]
    console.log(sentence3.join(" "))
}
else {
    console.log("No more bottles of coke on the wall, no more bottles of coke. Go to the store and buy some more, 99 bottles of coke on the wall")
}

}

// random_address streetname = ['A Street,','B Street,','C Street,','D Street,','E Street,', 'F Street,','G Street,','H Street,','I Street,','J Street,']; city = ['Madinah','Makkah','Riyadh','Buridah','Jeddah','Abha','Khaj','Ola','Jizzan','Tabuk'] region = ['Madinah,','Makkah,','Riyadh,','Qassim','Makkah','Assir','Riyadh','Madinah','Jizzan','Tabuk']

for (i=0 ; i<3 ; i++){

var Streetnumber = Math.floor(Math.random()100000) var Zipcode = Math.floor(Math.random()100000) var st= Math.floor(Math.random()10) var A = Math.floor(Math.random()10)

adress= [Streetnumber,streetname[st],city[A],region[A],Zipcode]

} console.log(adress.join(' '))

morojAlh commented 5 years ago

We discussed the homework one-on-one. Good job 👍🏼