Answered step by step
Verified Expert Solution
Link Copied!

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

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

College Algebra

Authors: Robert F Blitzer

7th Edition

013449492X, 9780134453262

More Books

Students also viewed these Programming questions

Question

a sin(2x) x Let f(x)=2x+1 In(be)

Answered: 1 week ago

Question

Evaluate each determinant in Exercises 2328. 2 -1 3 -4 2 05 04

Answered: 1 week ago