misk-jsd2 / 03-conditionals-and-loops

0 stars 10 forks source link

Fahad Alessa #3

Closed FahadAlessa90 closed 5 years ago

FahadAlessa90 commented 5 years ago

for (var i=99; i>=0; i--) { if (i===0) { 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.') } 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.') } if (i===2) { console.log(i + ' bottles of coke on the wall, '+ i +' bottles of coke. Take one down and pass it around, '+ (i-1) +' bottle of coke on the wall.') } if (i>2) { 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.') } }

var street_number = ['1234','5678','9012'] var street_name = ['Oruba street','King Fahad street','Olaya street'] var city_name = ['Riyadh','Jeddah','Dammam'] var state_name = ['Center','Western','Eastern'] var zip_code = ['12271','33451','45783']

var a = Math.floor(Math.random()street_name.length) var b = Math.floor(Math.random()street_name.length) var c = Math.floor(Math.random()street_name.length) var d = Math.floor(Math.random()street_name.length) var e = Math.floor(Math.random()*street_name.length)

console.log(street_number[a] + ' ' + street_name[b] + ', ' + city_name[c] + ' ' + state_name[d] + ', ' + zip_code[e])

morojAlh commented 5 years ago

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