Question: For this programming assignment, you will write a program to help the Maryland Pick 4 Lottery determine if there are winners for the evening drawing.
For this programming assignment, you will write a program to help the Maryland Pick 4 Lottery determine if there are winners for the evening drawing. A file (named tickets.txt) contains at least 1,000 different 4-digit number combinations for tickets sold that day. You will write a program that reads the numbers from this file, initializes an array with these numbers, and then prompts the user to enter the evening's winning 4-digit number. The program should perform a binary search through the list of ticket numbers and report the total number of winners for the evening. Once this information has been displayed, your program should report how many comparisons were made in the binary search. Your program will contain at least three (3) user-defined functions. Successful completion of this assignment includes (but is not limited to): Use of fstreams, selection, repetition, user-defined functions, arrays, and secure coding practices in this program Properly named .cpp file Inclusion of the algorithm used to develop your program as comments within your program A program that compiles and executes properly A program that properly reads data from the input file, prompts the user for the winning number, searches the list of numbers for a match, displays the number of winners and the number of comparisons made during the binary search
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
