ASSIGNMENT 5 – POWERBALL SIMULATION Powerball® is a combined large jackpot game and a cash game. Every Wednesday and Saturday night at 10:59 p.m. Eastern Time, we draw five white balls out of a drum with 69 balls (1-69) and one red ball out of a drum with 26 red balls (1-26). Draw sales cut off at least 59 minutes before the draw. Check for local cut-off time. Players win by matching one of the 9 Ways to Win. The jackpot (won by matching all five white balls in any order and the red Powerball) is either an annuitized prize paid out over 29 years (30 payments) or a lump sum payment. Each ticket costs $2. If the winner chooses the annuity, the annual payment will be increased each year by the percentage set out in the Powerball game rules. Your assignment is to write an EZ-Play program that would deliver 6 lucky numbers (5 white ball numbers and 1 red power ball number) for every game the player pays. Your Submission will follow the following example: // Author: John Doe // CIS 3100 BMWA Spring 2018 // Assignment 5 #include #include using namespace std; const int WHITEBALLS = 69; const int WHITEPICKS = 5; const int REDBALLS = 26; ………….. Your code is here …………..
CODE:
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
const int WHITEBALLS = 69;
const int WHITEPICKS = 5;
const int REDBALLS = 26;
const int REDPICKS = 1;
int main()
{
int i=0;
for(i=1;i<=WHITEPICKS;i++)
{
int
lucky=1+(rand()%WHITEBALLS);
cout<<"Lucky Number
"<<i<<" for white ball -
"<<lucky<<endl;
}
int
lucky=1+(rand()%REDBALLS);
cout<<"Lucky Number for red
ball - "<<lucky;
}
OUTPUT :
ASSIGNMENT 5 – POWERBALL SIMULATION Powerball® is a combined large jackpot game and a cash game. ...
The Powerball lottery is played twice each week in 44 states, the District of Columbia, and the Virgin Islands. To play Powerball, a participant must purchase a $2 ticket, select five numbers from the digits 1 through 69, and then select a Powerball number from the digits 1 through 26. To determine the winning numbers for each game, lottery officials draw 5 white balls out a drum of 69 white balls numbered 1 through 69 and 1 red ball out...
Please help to solve question 1 and subsections 1-4 1: Powerball Consider the multi-state lottery Powerball game. Each ticket is $2 and allows a player to select 5 white balls from 1 to 69 (without replacement), and 1 Red Powerball, from 1 to 26. The order of the five white balls does not matter when evaluating a win. If there are 64 losing whiteball numbers, how many ways can the winner pick 4 of them. If the player is only...
The Powerball is played by selecting five numbers (without repetition) from the white balls labeled 1 through 69 (the order doesn't matter) and one red ball (the powerball) with label from 1 through 26. You win the grand prize if you get all five white numbers plus the powerball. 3. (a.) How many possible tickets are there? What is the probability of winning the grand prize? (b.) You win $4 if you get the powerball and at most one white...
Bonus Question The Powerball multi-state lottery is played by picking 5 numbers between 1 and 59 (the white balls) and an additional bonus number between 1 and 39 (the red Powerball). Twice a week 5 white balls and a red Powerball are drawn from two separate drums revealing the winning numbers. To win at Powerball, your numbers must match the numbers on the winning balls in any of the following nine ways: 5 white balls + red Powerball (Grand Prize)...
Exercise 1.7 all, with clear explanations for each one. Exercise 1.7: If you buy a Powerball lottery ticket, you can choose 5 mbers between 1 and 59 (picked on white balls) and one number between 1 and 35 (picked on a red b How many ways can you (A) win the jackpot (guess all the numbers correctly)? (B) match all the white balls but not the red ball? (C) match exactly 3 white balls and the red ball? (D) match...
Write a C++ program that simulates playing the Powerball game. The program will generate random numbers to simulate the lottery terminal generated numbers for white balls and red Powerball. The user will have the option to self-pick the numbers for the balls or let the computer randomly generate them. Set the Grand Prize to $1,000,000,000.00 in the program. Project Specifications Input for this project: Game mode choice – self pick or auto pick Five numbers between 1 and 69 for...
The expected winnings are defined as the value of the jackpot multiplied by the probability of winning it. How large should the Powerball jackpot be in order for the expected winnings to exceed the ticket price ($2)? The Powerball lottery drawing of January 13th, 2016 had the largest payoff in its history, of $1.6 billion dollars. The lottery draw consists of picking 5 white balls at random, from an urn of 69 balls, numbered from 1 to 69 (without replacement,...
This question relates to pseudo random number generators. You will write a c program that pulls the Powerball numbers. You will demonstrate how a deterministic number generator works. In Powerball there are 5 white numbered balls that are pulled out of a drum containing 69 balls numbered 1-69. You cannot pull the same number twice. Additionally one red ball is numbered 1 to 26. You don’t have to worry about the PowerPlay option. A) Write a c program that simulates...
The North Carolina Education Lottery website has the following payout and odds for the Powerball. In this game, a ticket costs $2. You choose five different numbers from 1 to 69 and a so-called powerball number from 1 to 26 Odds 1:292,201,338 1:11,688,054 1:913,129 1:36,525 1:14,494 1:580 1:701 1:92 1:38 Scenario Match 5+PB Match 5 Match 4PB Match 4 Match 3+PB Match 3 Match 2+PB Match 1+PB Match 0+PB Payout 85,400,000 1,000,000 50,000 100 100 20) Show your calculations verifying...