Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Cash 5 Lottery. Cash 5 lottery asks the player to select 5 numbers from 1 and 35, and the player win the big prize
Cash 5 Lottery. Cash 5 lottery asks the player to select 5 numbers from 1 and 35, and the player win the big prize by matching all five numbers. Write a function that takes a vector that contains 5 unique winning integers, and another vector of 5 unique integers a player chose. The numbers are NOT sorted. The function returns the number of matches between the winning numbers and your ticket. Winning numbers Player's numbers Function returns {1, 12, 3, 20, 15} {15, 1, 4, 12, 35} 3 {35, 7, 26, 17, 8} (8, 7, 26, 35, 17} 5 {27, 2, 9, 15, 29} {3, 1, 8, 14, 20 0 Write a main program that asks the user to enter a set of 5 winning numbers (you can assume the user always enters valid numbers), then main program then reads 1000 Cash 5 tickets from a text file "dat_hw8_prob3.txt" (each line contains 5 numbers that the player chose for a ticket) and count how many tickets matches five numbers, four numbers, three numbers, two numbers using the function you just implemented. Report your results for the winning number {31, 17, 4, 5, 20) in the write-up. Submit your .cpp file as "yourLastName hw8 prob3.cpp".
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