Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A lottery player bought lottery 1 0 tickets with the following numbers 1 3 5 7 9 2 4 5 7 9 3 2 9
A lottery player bought lottery tickets with the following numbers
Write a program in C that will initialize an array or a vector with the numbers
of the tickets bought shown above. Then prompt user to enter a digits
number for the winning number.
Your job is do a linear search of the winning numbers on the arrayvector that has
the numbers of the tickets bought. This linear search must be done in a function.
If the search is successful, return index where search value was found otherwise,
return if value sought is not the array. You must have a function that will
accept the array and return where winning numbers were found. Return if not
found.
Test program to make this is working.
Then add a sort function to sort the array above and the a binarySearch
method to search for the winning numbers in the array already sorted. Return
where the winning numbers was found if found, else return
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