misk-jsd2 / 03-conditionals-and-loops

0 stars 10 forks source link

IBRAHIM ALDUAYJI #11

Closed alduayji closed 5 years ago

alduayji commented 5 years ago

// bottels of cock for (var a = 99; a >= 0; a--){

    if (a < 100 && a > 1){
        console.log(a + " bottles of coke on the wall, " + a + " bottles of coke. Take one down and pass it around, " + (a-1) + " bottles of coke on the wall.");         
    } else if (a < 2 && a > 0) {
    console.log(a + " bottle of coke on the wall, " + a +  " bottle of coke. Take one down and pass it around, no more bottles of coke on the wall.");
} else if (a < 1){
    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.");
}

}

//random address

var city = ['riyadh', 'jeddah', 'dammam', 'shaqra', 'dhahran']; var streetName = ['mohammad', 'ahmed', 'khaled', 'Ibrahim']; var region = ['RY', 'ES', 'MK', 'NTH'];

var getRandom = Math.floor((Math.random() * (99999) + 11111));
var number2 = [getRandom];

var getCity = Math.floor((Math.random() * city.length)) + 0;
var city2 = [getCity];
var city3 = city[city2];

var getStreet = Math.floor((Math.random() * streetName.length)) + 0;
var street2 = [getStreet];
var street3 = streetName[street2];

var getRegion = Math.floor((Math.random() * region.length)) + 0;
var region2 = [getRegion];
var region3 = region[region2];

var getRandom2 = Math.floor((Math.random() * (99999) + 11111));
var number3 = [getRandom2];

onsole.log(number2 + ' ' + street3 + ' Street, ' + city3 + ' ' + region3 + ', ' + number3);

morojAlh commented 5 years ago

We discussed the homework one-on-one. Good job šŸ‘šŸ¼