Question 1 (20 Points)
Lottery games award players for money if they are able to match two, three four, or five integers from integers selected at random in a range 1 to M (inclusive of M). Simulate a lottery game by designing a well-documented Python function, lotteryPick(M) that accepts an integer greater than five and returns a list of randomly selected integers. You will need to use Python’s random module. Also, consider using the sample function embedded in the random module. Your call to sample should be of the form sample(range(1, M+1),5). In addition, your function should NOT return a value when the user selects an M less than 5. Under this condition have your function return an empty list.
Test your function inside the main program lottery.py. Your main program should ask the user for an integer M representing the range M for the lottery. The program should test to ensure the integer is greater than or equal to 5. If not, the program should continue to query the user. Next, your program should call lotteryPick(39) one time to represent your “Quick_Pick”. A “Quick_Pick” represents a random selection made by you. Next, have your main program call lotteryPick(39) again to represent the actual drawing. In addition, have the main program test whether or not your “Quick_Pick” has won by testing if zero, one, two, three, four or five matches have been made – and displaying the result. Finally, ask the user if they would like to play the program again with a “y/n prompt?”.
Grading: 4 Points for comments, 4 Points for python function lotteryPick(M), 8 Points for the main program lottery.py that tests your function appropriately and 4 Points for a screen capture that depicts the display your main program creates after a drawing.
Screen Capture
Question 2 (20 Points)
Lottery games award players for money if they are able to match two, three four or five integers from integers selected at random in a range 1 to M (inclusive of M). Design a well-documented, Python main program that uses the function lotteryPick(M) to estimate the probability of winning a lottery game in the range 1 to M (inclusive of M) by repeating the lottery game 10N trials. Ask the user for the value of N as a prompt in your program lottery2.py. To estimate the probability of winning with only one match, for example, have your code count the number of times one match is found in 10N trials and divide it by the number of trials.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme