Hi every one, i have been given an assignment, and i need your help in making the programme. The question is

Write a program to simulate a lottery game where a set of the lottery numbers includes 6 different numbers from 1 to 49. A possible run may look e like:

Enter your lottery numbers: 3 10 18 23 37 41
The winning numbers randomly selected by the computer are: 3 12 18 27 37 49
You won 3 stars: 3 18 37
Enter your lottery numbers: 5 7 18 23 32 44
The winning numbers randomly selected by the computer are: 6 12 17 29 38 47
Your lottery numbers don't match any number. Thanks for playing the lottery game.

3
Contributors
5
Replies
14
Views
3 Years
Discussion Span
Last Post by JerrimePatient
• choose 6 numbers and it must not be repeated.
• Random a number for 6 times and the Random number must not repeat.
• match the choosen number and the random numbers.
• count if the choosen number is match to random numbers.

God Bless and happy programming.

Actually i am new to programming and i am really weak in basics, and what method do we use to match de numbers?

that would depend on the datatype. especially when you are weak, you should try yourself, by just asking someone to do it for you, you won't learn anything.

what have you got so far?

all of us start at the very beginning but to must strive to be the best. programming world is too huge, but we are willing to help you, if you want to improve.

I know you can do it, like what we are now.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.