misk-jsd2 / 03-conditionals-and-loops

0 stars 10 forks source link

Moneera Alnasser #9

Closed moneeraalnasser closed 5 years ago

moneeraalnasser commented 5 years ago

1= if the result random var streetNumber = ['22229', '85679', '35758', '15575', '92234', '73234']

var streetName = ['nashwan street', 'abo baker street', 'othman bn affan street', 'abdulaziz street', 'makkah street', 'salman street',]

var cityName = ['Riyadh', 'arar', 'makkah', 'dammam', 'jeddah', 'Maddena', 'Haiel']

var stateName = ['Qassem State', 'North State', 'East State', 'South State', 'West State']

var zipCode = ['28839', '94459', '35448', '23456', '93355', '86241']

function getRandom(input) { return input[Math.floor((Math.random() * input.length))]; }

function createAdress() { return ${getRandom(streetNumber)} ${getRandom(streetName)} ${getRandom(cityName)} ${getRandom(stateName)} ${getRandom(zipCode)}; }

var address = createAdress(); console.log(address);

and if not it will be var address

var streetNumber = ['25489', '87459', '35478', '15975', '95125', '78965']

var streetName = ['A street', 'B street', 'C street', 'D street', 'E street', 'F street',]

var cityName = ['Riyadh', 'Dammam', 'Jedda', 'Tabouk', 'Makka', 'Maddena', 'Haiel']

var stateName = ['Qassem State', 'North State', 'East State', 'South State', 'West State']

var zipCode = ['28889', '96459', '35748', '15005', '99625', '71465']

2=

for (var i = 99; i >= 0; i--) { if (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{ 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."); }}

morojAlh commented 5 years ago

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