Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me with this Design for a C program, please make it as simple as possible because I'm in programming 1 and I just

Please help me with this Design for a C program, please make it as simple as possible because I'm in programming 1 and I just started.

This program is a lottery program:

image text in transcribed

Here's more information about the data structure and algorithm:

image text in transcribed

Here's what the Algorithm should look like and what I have so far:

image text in transcribed

image text in transcribed

Thank you so much in advance

Lottery Design 4: typed algorithm code for program 4 with a picture of data structure. Have at least a function to print an integer array of length 7 and one to bubble sort an integer array of length seven. Write a C program that asks the user for 7 numbers (positive integers) from 1 to 50. Generate 7 random numbers from 1 to 50 (hint: use srand(time(NULL)) and rand(), and (x%50)+1). Make a function called bubble that sorts a list of 7 numbers using the bubble sort algorithm (call bubble twice). Print out the users guess in the order given by the user and in numeric order. Print out the random numbers you generated in the order that you generated them and in numeric order (remember, both sets of numbers must be unique numbers). Let the user know how many and which numbers matched your lottery numbers. Be sure to give the user specific instructions. Data - 2 arrays of 7 integers draw picture o Algorithm first cut - you expand Functions - besides main, have at least o bubble sort o print array of 7 integers o check for a duplicate item in a list Algorithms and Programming Style An algorithm is a list of steps or actions written in pseudo code so that the steps can be programmed in any high-level programming language. A silly example for getting ready in the morning using action verbs to start the steps for two functions is main: get out of bed go to the bathroom eat breakfast if the high temperature is less than 60F pick out warm clothes else pick out layers of clothes put on clothes gather belongings to take walk out the door eat breakfast: select what to have for breakfast get out food make food while there is more food left take a bite of food chew food swallow food put dishes in sink for each dish wash it Main Get user's numbers and check if in range and no duplicates Get random numbers that consist of no duplicates Print user list Print random list Sort user list Sort random list Print user ordered list Print random ordered list Check for and print matches Print out number of matches Bubble Sort while there were swaps set swap to 0 for each adjacent pair if first second set temp to first set first to second set second to temp set swap to 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions