misk-jsd2 / 03-conditionals-and-loops

0 stars 10 forks source link

abeer alquriny #4

Closed abeersq closed 5 years ago

abeersq commented 5 years ago

//random_address var street_name =['A street', 'B street', 'C street', 'D street', 'E street']; var street_number =['123','321','456','654','789','987']; var state_name =['North State', 'East State', 'South State', 'West State'] var city_name=['Riyadh', 'Dammam', 'Jedda', 'Makka', 'Maddena']; var zip_code =['1234','4321','5678','8765','9358'];

var template = [street_number, " ", street_name, ", ", city_name, " ", state_name, ", ", zip_code];

for (var i = 0; i < 5; i++) { var result= street_name[i]+" , "+street_number[i]+" , "+city_name[i]+" , "+zip_code[i];

console.log(result); }

//bottles_of_coke

for (var i = 99; i >= 0; i--) { if (i > 1){ console.log(i,"Bottles of Coke on the Wall",i,"bottles of coke. Take one down and pass it around",i-1,"bottles of coke on the wall."); }else if (i == 1) { console.log(i," bottle of coke on the wall,",i," bottle of coke. Take one down and pass it around, no more bottles of coke on the wall."); }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."); }}

morojAlh commented 5 years ago

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