misk-jsd2 / 03-conditionals-and-loops

0 stars 10 forks source link

Raghad Alminqah #20

Closed RaghadAlminqah closed 5 years ago

RaghadAlminqah commented 5 years ago

Assigment 1: var b = 0;

for (var i = 99 ; i >= b; i--) { if ( (i > b) && (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 > b) && (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 if ( i == b){ 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 {

} }

Assigment 2:

var streetN = ['11111', '22222', '33333', '44444', '55555', '66666']; var streetNa = ['Salman Aludwani Road', 'King Abdullah Road ', 'Alhasan Ibn Ali Road', 'Northan Ring Road', 'Shaikh Hasan Ibn Hussain Ibn Ali Road']; var city = ['Riyadh', 'Jeddah', 'Abha', 'Aldammam', 'Tabuk']; var stateN = ['45334', '67655', '77654', '54224', '55642']; var zipcode = ['22353', '13155', '11285', '12334', '11324'];

var random1 = Math.floor((Math.random() streetNa.length)); var random2 = Math.floor((Math.random() streetN.length)); var random3 = Math.floor((Math.random() city.length)); var random4 = Math.floor((Math.random() stateN.length)); var random5 = Math.floor((Math.random() * zipcode.length));

console.log(streetN[random2] + " "+ streetNa[random1]+ " " + city[random3] +" " + stateN[random4 ]+" " + zipcode[random4]);

morojAlh commented 5 years ago

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