Lottery Winners Program Urgent Help Needed!
Hi !
I'm having a great deal of problems with this programming project. I am due to code a Lottery winners exercise with the following instructions:
Lottery Winners program.
A lottery ticket buyer purchases ten tickets a week, always playing the same ten 5-digit "lucky" combinations. Write a program that initializes an array with these numbers and then lets the player enter this week's winning 5-digit number. The program should perform a linear search through the list of the player's numbers and report whether or not one of the tickets is a winner this week. Here are the numbers:
13579 26791 26792 33445 55555
62483 77777 79422 85647 93121
Extend this challenge by permitting any number of lottery entries, and using a pointer instead of a fixed array. The general idea is this:
§ Declare your array of numbers as a pointer to int, rather than as a fixed array of int.
§ Have the first number entered by the user of your program be the number of entries. Let this number be N.
§ Allocate space for the array using new.
§ The remaining input should be the N lottery numbers.
§ Proceed with the rest of the program to carry out binary searches in your array. You need a loop that repeatedly asks for a number, then says whether its a âwinnerâ or not. Enter a 0 to stop the loop and return from the program.
§ Release the array space before returning using delete.
Testing this program by typing in all the numbers can be challenging. Instead, consider writing the âuser entriesâ as a text file, then, in Visual Studio:
· Select Project/Settings/Debug.
· Enter the name of your text file in the Program Arguments panel, preceded by â<â, like this:
< TextFileName.txt
· Your text file should be in the same directory as your project. This will happen if you use Visual Studio to open a text file, fill it in with the editor, then save it with a simple name.
This project is due in a day! I have become sick prior to starting this project, but trying to figure this out and given all the attempts I have made I have put myself in an even worst situation. This is driving me insane!
I need help, please! Anything is appreciated!
|