misk-jsd2 / 03-conditionals-and-loops

0 stars 10 forks source link

Fahad Alajmi #13

Closed fahad5 closed 5 years ago

fahad5 commented 5 years ago

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

}

//---------------------------Q2--------------------------------

var street_num = ["2146", "4285", "4544", "4593", "4198", "2518", "1181", "3375", "3755", "1613", '1148'] ; var street = ["Columbia Boulevard", "Tanglewood Road", "Hamill Avenue", "Confederate Drive", "Foley Street", "Settlers Lane", "High Meadow Lane", "Coleman Avenue", "Green Hill Road", "Bird Spring Lane","Spring Haven Trail"] ; var city = ["Elkridge", "San Diego", "Danville", "Fayetteville", "Doylestown", "West Warwick", "Palmyra", "Keysville", "Lawrence", "Tampa","Bloomfield"] ; var state = ["MD", "CA", "TN", "DE", "KY", "CO", "MS", "IL", "HI", "OH","NJ"]; var zip = ["93401", "95050", "98203", "49224", "60637", "32541", "47408", "70112", "13202", "30249", "07003"];

var a = Math.floor(Math.random() 10) + 1; var a1 = street_num[a]; var a = Math.floor(Math.random() 10) + 1; var a2 = street[a] ; var a = Math.floor(Math.random() 10) + 1; var a3 = city[a]; var a = Math.floor(Math.random() 10) + 1; var a4 =state[a] + ","; var a = Math.floor(Math.random() * 10) + 1; var a5 = zip[a]; console.log(a1 + " " + a2 + " street, " + a3 + " " + a4 + " " + a5);

morojAlh commented 5 years ago

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