Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this assignment, you are supposed to write a C program for the Lotto 6/49 Game where game rules and example outputs are given below.
In this assignment, you are supposed to write a C program for the Lotto 6/49 Game where game rules and example outputs are given below. Rules: 1. Each coupon has 8 columns. 2. For each column, 6 random integers, varying from 1 to 49 , must be generated. 3. All the numbers ( 6 integers) in a column must be different (A number shouldn't appear more than once). 4. A user may play more than 1 column. 5. A user may play with more than 1 coupon. Your C program must have following requirements: - The main function must include a menu in as shown in example outputs. - User must enter his choice for whether he/she wants to play coupon (C) or column (B). In addition, user must enter how many coupons or columns he/she wishes to play. - There should be a user-defined function which takes the inputs of the user and must have the following prototype: void loto6_49(int amount, char choice); This function must perform following tasks: 1. Generate specified number of random integers for columns in each coupon. 2. All the integers in a column must be sorted in ascending order. 3. An integer shouldn't appear more than once in a column. 4. Integers in different columns can be same. B-P1ay Column C-Play Coupon play coupon (C) or play colunn (B) enter please?: B how many columne(B). he/she wiahes to play enter please?: 5 2.Column: 3.Column: 5. Column: ...Program finished with exit code 0 Press ENrER to exit console. Lotto 6/49 game B-Play Column C-play Coupon play coupon (C) of play column (B) enter please?: C how many coupons(C) he/she wishes to play enter Bleasep: 2 1. Coupon 1.columnt 121721253035 1. Coupon 2.column: 1.7100161933 1. Coupon 3 . column: 1. Coupon 4. column: 51214162026 1. Coupon 5.column: 101123262735 1. Coupon 6.column: 4913192439 1. Coupon 7.column: 21418252835 1. Coupon 8. column: 3818222533 2. Coupon 1. column: 31215182034 2. Coupon 2. column: 679353940 2. Coupon 3. column: 71720252731 2. Coupon 4.column: 1523303132 2. Coupon 5.column: 31517202240 2. Coupon 6.column: 121315181931 2. Coupon 7.column: 81726283233 2. Coupon 8. column: 91215263442
Step 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