MATLAB Designing a Simple Lottery Machine: User Input & Prize Calculation

AI Thread Summary
The discussion centers on creating a simple lottery machine program that allows users to select three numbers between 1 and 20. The program should randomly generate three winning numbers within the same range and compare them to the user's selections. The payout structure is defined: no matches yield no winnings, one match results in $10, two matches yield $50, and three matches provide $200. Participants emphasize the importance of program design, including the use of loops for number selection and matching. Additionally, there is a request for guidance on testing the program's functionality to ensure it operates correctly. The conversation highlights the need for beginner-friendly explanations and support in coding practices.
coso21
Messages
2
Reaction score
0
I need help writing the code for a simple lottery machine. Here are the key points.

Ask the user to choose 3 numbers between 1 and 20. Randomly generate 3 winning numbers that are between 1 and 20. Determine how many, if any, of the users numbers match the winning numbers. If (hypothetically) no matches doesn't win anything, 1 match wins $10, 2 matches wins $50 and 3 matches wins $200, tell the user how much they have theoretically won. Write down your program design process. How can you check if the program works?

Thanks to anyone who can help me out. It will be greatly appreciated.
 
Physics news on Phys.org
How about you do your own homework?
 
I'm just a beginner. All I know is that i need some loops but don't know how they are going to work...I need help
 
Back
Top