C++ programming: lottery
Can same one help me out with a example finsih and working programm ?
Program a simple lottery game (7 out of 21) (as class
lotto):
● There are 3 players participating. At the beginning each player
receives a lottery ticket
○ consisting of 21 numbers (the values from 0 to 20),
○ on which he "ticked" 7 numbers.
● After "handing in" the betting slips, 7 numbers are drawn.
● After the draw, the winners are announced with their game
results.
● Implement the following menu for this:
=== Menu ===
1 Fill out a betting slip
2 lucky numbers draw
3 Announcing the winners
0 EXIT
Selection (0-3): _
● Explanation of the individual menu items1:
1. fill in the betting slip: To do this, implement a method
which
asks the players one by one to fill in their betting slip2.
2. draw lucky numbers: Implement a method of drawing which
which randomly generates 7 numbers one after the other3 , outputs
them to the screen
and then indicate for each player whether he had ticked them.
3. announce the winners: The pools coupons and results of all
players and the
drawn numbers are output. To do this, implement a method
result.
#include<bits/stdc++.h>
#include<time.h>
using namespace std;
int bettingSlip1[7];
int bettingSlip2[7];
int bettingSlip3[7];
int draw[7];
void fillBettingSlip()
{
cout<<"Player 1 turn enter 7 number between 0 to 20 :";
for(int i = 0; i < 7; i++)
cin>>bettingSlip1[i];
cout<<"Player 2 turn enter 7 number between 0 to 20 :";
for(int i = 0; i < 7; i++)
cin>>bettingSlip2[i];
cout<<"Player 3 turn enter 7 number between 0 to 20 :";
for(int i = 0; i < 7; i++)
cin>>bettingSlip3[i];
}
void luckyDraw()
{
srand(time(0));
for(int i = 0; i < 7; i++)
draw[i] = rand() % 21;
cout<<"The draw numbers are: ";
for(int i = 0; i < 7; i++)
cout<<draw[i]<<" ";
cout<<endl;
}
void winner()
{
int player1 = 0;
int player2 = 0;
int player3 = 0;
for(int i = 0; i < 7; i++)
{
cout<<"For draw Number: "<<draw[i]<<endl;
for(int j = 0; j < 7; j++)
{
if(draw[i] == bettingSlip1[j])
{
cout<<"\tSelected by Player1"<<endl;
player1++;
}
if(draw[i] == bettingSlip2[j])
{
cout<<"\tSelected by Player2"<<endl;
player2++;
}
if(draw[i] == bettingSlip3[j])
{
cout<<"\tSelected by Player3"<<endl;
player3++;
}
}
}
if(player1 >= player2 && player1 >= player3)
cout<<"Player 1 is winner with "<<player1<<"
matches"<<endl;
else if(player2 >= player1 && player2 >=
player3)
cout<<"Player 1 is winner with "<<player1<<"
matches"<<endl;
else if(player3 >= player1 && player3 >=
player2)
cout<<"Player 1 is winner with "<<player1<<"
matches"<<endl;
}
int main()
{
fillBettingSlip();
luckyDraw();
winner();
return 0;
}
//Please save the code with .cpp extension and refer screenshots for output and indentation purpose.




C++ programming: lottery Can same one help me out with a example finsih and working programm...
C++ programming: Card game Can same one help me out with a example finsih and working programm ? Program the basis for a card game (as a class card game): ● A card is represented by its suit/symbol (clubs, spades, hearts, diamonds) and a value (seven, eight, nine, ten, jack, queen, king, ace). ● A deck of cards consists of a pile of 32 cards that are completely connected to four players are distributed. ● Implement the following menu: ===...
C++ Programming: Customer file Can same one help me out with a example finsih and working programm ? Program a simple customer file. Each customer should be defined as a class customer can be modelled with the following attributes: Last name, first name, unique Customer number, postcode, place of residence. Implement the following menu for this: (e) Enter a new customer from Keypad (l) Deleting a customer (a) Output of all customers (x) Exit Comments: - At point (e) the...
Need help with assignment This assignment involves simulating a lottery drawing. In this type of lottery game, the player picks a set of numbers. A random drawing of numbers is then made, and the player wins if his/her chosen numbers match the drawn numbers (disregarding the order of the numbers). More specifically, a player picks k distinct numbers between 1 and n (inclusive), as well as one bonus number between 1 and m (inclusive). "Distinct" means that none of the...
java/javafx assignment: Island Paradise just started running their city lotto. You've been tasked with writing a program for them. The program is going to allow to user to first select their lotto numbers. The program will then randomly generate the winning lotto numbers for the week and then check the winning numbers against the random ticket the user played in the Lotto to see how many numbers the user guessed correctly. The rules for lotto work as follows: Select 7...
C programming language Purpose The purpose of this assignment is to help you to practice working with functions, arrays, and design simple algorithms Learning Outcomes ● Develop skills with multidimensional arrays ● Learn how to traverse multidimensional arrays ● Passing arrays to functions ● Develop algorithm design skills (e.g. recursion) Problem Overview Problem Overview Tic-Tac-Toe (also known as noughts and crosses or Xs and Os) is a paper-and-pencil game for two players, X and O, who take turns marking the...
Problem Statement: A company intends to offer various versions of roulette game and it wants you to develop a customized object-oriented software solution. This company plans to offer one version 100A now (similar to the simple version in project 2 so refer to it for basic requirements, but it allows multiple players and multiple games) and it is planning to add several more versions in the future. Each game has a minimum and maximum bet and it shall be able...
Please help as it is very important task for me please write in Python code and divide this into function and write comments for it 1. Ask the player’s name and welcome them to the game using their name. 2. Ask the player what is par for this game (number between 3-5 inclusive) 3. Ask the player what the distance to the hole for this game is (whole number between 195 and 250 inclusive) 4. Show the game menu: (I)nstructions...
Please, I need help with program c++. This is a chutes and ladders program. The code must be a novel code to the specifications of the problem statement. Thank you very much. Assignment Overview This program will implement a variation of the game “chutes and ladders” or “snakes and ladders:” https://en.wikipedia.org/wiki/Snakes_and_Ladders#Gameplay. Just like in the original game, landing on certain squares will jump the player ahead or behind. In this case, you are trying to reach to bottom of the...
Need C programming help. I've started to work on the program, however I struggle when using files and pointers. Any help is appreciated as I am having a hard time comleting this code. #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_LINE 100 #define MAX_NAME 30 int countLinesInFile(FILE* fPtr); int findPlayerByName(char** names, char* target, int size); int findMVP(int* goals, int* assists, int size); void printPlayers(int* goals, int* assists, char** names, int size); void allocateMemory(int** goals, int** assists, char*** names, int size);...
i need this in C# please can any one help me out and write the full code start from using system till end i am confused and C# is getting me hard.I saw codes from old posts in Chegg but i need the ful complete code please thanks. Module 4 Programming Assignment – OO Design and implementation (50 points) Our Battleship game needs to store a set of ships. Create a new class called Ships. Ships should have the following...