Question
What i did so far #include #include #include //generates random number in given range int getRandom(int min,int max){ return (rand() % (max - min +
What i did so far
#include
//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"); printf(" 1 - user entered 2 - Randomly generated. "); printf("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%d 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; }
Problems indicated
PLEASE only C langauge. No other langauges. I provided details so that fixing my program is easier. Please help me by providing a clear program.
Thank you .
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 'T', 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, 071, 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 method1 Welcome to Single Row BINGO How would you like to create your BINGO Card? 1 - user entered 2 - randomly generated Please enter your choice: **1** Generating your card from user input.. . Enter a number [01-15] Eor B: **10* Enter a number [16-30] for I: *25* Enter a number [31-45] Eor N: *36* Enter a number [46-60] for G: **60* Enter a number [61-75] for o: *65* Your BINGO card is: B10 125 N36 G60 065 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 showrn 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 Welcome to Single Row BINGO How would you like to create your BINGO Card? 1 - user entered 2 - randomly generated Please enter your choice: **2** Randomly generating your card... Your BINGO card is: B13 I24 N41 G54 062 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 cardStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started