Javascript project
// Jesus Ramos Acevedo // Scalable Data Infrastructure // Term 02// Functions Assignment var lottoNumbers var powerBallNumber var selectGame = prompt("Choose if you want to play Lotto or Power Ball\n\n Remember, it is case sensitive"); function game(selection) { if (selection === "Lotto") { selection = console.log ("Here are your Lotto numbers. Good Luck"); } } game(selectGame); //Lotto Generator function randomNumGen(max, min) { var randomNum = [];//creates an array with random numbers for (var i = 0; i < 6; i++) { randomNum[i] = Math.random() * (max - min) + min; // subtracts the max number from minimum number and adds the minumum randomNum[i] = Math.round(randomNum[i]);// rounds the number to the next integer. } return randomNum; } //PowerBall Generator function powerBall(max, min) { var randomNum = [];//creates an array with random numbers for (var i = 0; i < 6; i++) { randomNum[i] = Math.random() * (max - min) + min; // subtracts the max number from minimum number and adds the minumum randomNum[i] = Math.round(randomNum[i]);// rounds the number to the next integer. } return randomNum; } powerBallNumber = powerBall (1, 52); lottoNumbers = randomNumGen(1, 52); console.log(" " +lottoNumbers + " "); console.log("Here is your Powerball" + powerBallNumber);