misk-jsd2 / 03-conditionals-and-loops

0 stars 10 forks source link

Abdulaziz Alaboodi #8

Closed Aziz891 closed 5 years ago

Aziz891 commented 5 years ago

for (i = 99; i >0; i--) {

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.`)

}

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.`)
    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.')

}
else {

    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.`)

}

}

streetNumber = ['3233', '4852', '9605', '7801', '9932'] streetName = ['Abu Bakr Street','Omar Street', 'Uthman Street', 'Ali Street', 'King Saud'] city = ['Riyadh', 'Buraydah', 'Dammam', 'Abha','Jeddah'] state = ['Riyadh', 'Qassim', 'Assir', 'Mecca','Eastern Province'] zipCode = ['3233', '4852', '9605', '7801', '9932']

function randomize() {

return Math.floor(Math.random()*5)

}

console.log( streetNumber[randomize()] + ' ' + streetName[randomize()] + ', ' + city[randomize()] + ' '+ state[randomize()] + ', ' + zipCode[randomize()])

morojAlh commented 5 years ago

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