Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MUST BE DONE IN PROGRAM C The goal of this project is to create a Single Row BIN

ID: 3750555 • Letter: M

Question

MUST BE DONE IN PROGRAM C

The goal of this project is to create a Single Row BINGO "card" and to compare the "card" with randomly generated BINGO "calls." BINGO is typically played with a 5x5 grid, where the first column is labeled 'B', the second 'I', the third 'N", the fourth 'G', and finally the fifth 'O'. The B-column is associated with integer values 1-15 (inclusive), the I-column with 16-30 (inclusive), the N-column 31-45 (inclusive), the G-column 46-60 (inclusive), and the O-column 61-75 (inclusive). For ease in navigating a BINGO card during play, elements of a BINGO card and BINGO calls are represented by both the letter and number, e.g. B15, N35, O71, etc.

We will not be dealing with a full 5x5 card and we will not be playing a real game of BINGO. Instead, your mission is to give the user the choice of two ways to create a Single Row BINGO "card" consisting of one entry from each column (one of each letter in "BINGO"). The first method is a user generated card, where the program asks the user to enter in values for each of the five card elements. Here is output (note: the numbers surrounded by double asterisks are sample entries from the user and are not actually part of the program output) for method 1:

Make sure the user enters the values in the B-I-N-G-O order and that the BINGO card is printed to the screen in precisely the format shown above, with a single space between each element of the card.

The second method is a randomly generated card, where the program provides the five card elements using random numbers.
Here is output for method 2:

Make sure the BINGO card is printed to the screen in precisely the format shown above, with a single space between each element of the card.

Once a Single Row BINGO card has been generated, "play" a game of Single Row BINGO by letting the user decide how many BINGO calls to make. Randomly generate BINGO calls. For each call, check if it is a match to the Single Row BINGO card created earlier in the program, and clearly signify a match by printing "BINGO!!!" to the screen (i.e. a BINGO in Single Row BINGO is simply a single match). After all calls have been made, summarize the game by reporting the total number of BINGOs that occurred and the percentage of calls that resulted in a BINGO. Here is a sample output (again the double asterisks represent user input):

Explanation / Answer

PROGRAM IN C :

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

//generates random number in given range
int getRandom(int min,int max){
return (rand() % (max - min + 1)) + min;
}

int main() {
printf("Welcome to Single row BINGO ");
printf("How would you like to create your BINGO card 1 - user entered 2 - Randomly generated. Please enter your choice: ");
int choice;
int b,i,n,g,o;
scanf("%d",&choice);
if(choice==1){
printf(" Generating your card from user input...");
printf(" Enter a number [01-15] for B : ");
scanf("%d",&b);
printf(" Enter a number [16-30] for I : ");
scanf("%d",&i);
printf(" Enter a number [31-45] for N : ");
scanf("%d",&n);
printf(" Enter a number [46-60] for G : ");
scanf("%d",&g);
printf(" Enter a number [61-75] for O : ");
scanf("%d",&o);
printf(" Your BINGO card is: B%02d I%d N%d G%d O%d",b,i,n,g,o);
  
}else if(choice==2){
printf(" Randomly generating your card...");
  
// Use current time as seed for random generator
srand(time(0));
  
//random
b = getRandom(1,15);
i = getRandom(16,30);
n = getRandom(31,45);
g = getRandom(46,60);
o = getRandom(61,75);
printf(" Your BINGO card is: B%02d I%d N%d G%d O%d",b,i,n,g,o);
}else{
return -1;
}
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote