misk-jsd2 / 03-conditionals-and-loops

0 stars 10 forks source link

Hussam Alkhaibari #22

Closed husamx99 closed 5 years ago

husamx99 commented 5 years ago

//Bottles Of Coke for (var 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.");     
} else 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.");  
} 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.");      
           }

}

//Random Address

var streetNumbers = [60,44,333,100,15]; var streetName = ['Olyya','Najd','Laban','King Fahad','King Salaman']; var cityName = ['Dammam','Aldereyyah','Yanbu','Jeddah','Samtah']; var stateName = ['Riyadh','Makkah Almokarmah','Alsharqyyah','Almadena','Jazan']; var zipCode = [5352,2527,4367,8742,6743];

var randStreetNum = streetNumbers[Math.floor(Math.random() streetNumbers.length)]; var randStreet = streetName[Math.floor(Math.random() streetName.length)]; var randCity = cityName[Math.floor(Math.random() cityName.length)]; var randState = stateName[Math.floor(Math.random() stateName.length)]; var randZip = zipCode[Math.floor(Math.random() * zipCode.length)];

var randomAddress = randStreetNum+' ' + randStreet+' Street, ' + randCity+' ' + randState+', ' + randZip console.log(randomAddress);

morojAlh commented 5 years ago

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