//Random Address
function getrandom(min, max) {
return Math.floor(Math.random() * (max - min + 1) ) + min;
}
var streetNum = [13466,19823,17039];
var streetName = ["A2 Street","B1 Street","D5 Street"];
var cityName = ["Vigo","Granada","Bilbo"];
var stateName = ["Galicia","Basque Country","Andalusia"];
var zipCode = [44793,33945,10620];
console.log(streetNum[getrandom(0,2)]+" "
streetName[getrandom(0,2)]+", "
cityName[getrandom(0,2)]+" "
stateName[getrandom(0,2)]+", "
zipCode[getrandom(0,2)]);
//99 Bottles of Coke
for(var i = 99; i >= 0; i--) {
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 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{
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 function getrandom(min, max) { return Math.floor(Math.random() * (max - min + 1) ) + min; }
var streetNum = [13466,19823,17039]; var streetName = ["A2 Street","B1 Street","D5 Street"]; var cityName = ["Vigo","Granada","Bilbo"]; var stateName = ["Galicia","Basque Country","Andalusia"]; var zipCode = [44793,33945,10620];
console.log(streetNum[getrandom(0,2)]+" "
//99 Bottles of Coke for(var i = 99; i >= 0; i--) { 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 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{ 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."); } }