Click here to Skip to main content
15,908,775 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using Visual C++ 6 to create DOS applications Pin
Nish Nishant2-May-02 14:09
sitebuilderNish Nishant2-May-02 14:09 
GeneralRe: Using Visual C++ 6 to create DOS applications Pin
Jeremy Falcon2-May-02 16:32
professionalJeremy Falcon2-May-02 16:32 
Generalsetting pixels colors Pin
RalfPeter2-May-02 8:38
RalfPeter2-May-02 8:38 
GeneralRe: setting pixels colors Pin
Jack Handy2-May-02 11:30
Jack Handy2-May-02 11:30 
GeneralRe: setting pixels colors Pin
Chris Losinger2-May-02 11:38
professionalChris Losinger2-May-02 11:38 
GeneralRe: setting pixels colors Pin
Jack Handy2-May-02 12:18
Jack Handy2-May-02 12:18 
GeneralRe: setting pixels colors Pin
Chris Losinger2-May-02 12:46
professionalChris Losinger2-May-02 12:46 
GeneralI NEED HELP!!! Pin
Donna2-May-02 8:19
Donna2-May-02 8:19 
Following is instructions for a small program that I have to write for school but I can't get mine to work properly. I would be forever grateful to someone if they could help me out. Here are the instructions:
5 individuals have bought lottery tickets in SCs new pick 6 lottery.
Have each person enter her name and her six numbers (the numbers
must be between 1 and 48, and there should be no duplicate values).
After all of the names and tickets are entered, populate (fill) a 6
element array with 6 randomly generated numbers (no duplicates!).

If a user picked 4 of the numbers correctly - she wins $1000.
If a user picked 5 of the actual numbers - she wins $10000.
If a user picked all 6 numbers correctly - she wins $1000000.
Note, the order of the numbers does not matter.
Print out the names of each winner and the amount of money
she won.

Your program must use AT LEAST two functions in addition to your
main (write more if you would like):
1. Write a function that takes an array and a size as its parameters.
This function should fill the array with random numbers between 1
and 48 - ensuring that there are no duplicates.

2. Write a linear search function.



Here is a suggested plan of attack:
1. Make your program read in one person's name and lottery picks
(into an character array with one row and 20 columns and a one
dimensional integer array with 6 columns).
2. Make sure that the user's numbers are in range and are not duplicates.
Do this as the numbers are being read in. - YOU CAN SKIP THIS
STEP AND COME BACK TO IT AT THE END IF YOU WANT
3. Write a function that takes an integer array as its parameter and
fills the array with 6 random numbers between 1 and 48.
4. Make sure the function written in step 3 is not allowed to place
duplicate values in the array. (You may want to reduce the number
of possible values to 1-6 in order to test that this feature is working)
- YOU CAN SKIP THIS STEP AND COME BACK TO IT AT THE
END IF YOU WANT
5. Print the elements in the array of randomly generated values.
6. Search the array of randomly generated values for each of the user's
numbers. Keep a count of the number of values found.
7. Construct a decision structure that will print the user's name and
winnings if she won.
8. Go back and make steps 1 and 2 read in 5 names and sets of
lottery picks.
9. Go back and make steps 6 and 7 check the picks for each of
the 5 people.


Cry | :(( Cry | :(( Confused | :confused:

Donna
GeneralRe: I NEED HELP!!! Pin
Ravi Bhavnani2-May-02 8:32
professionalRavi Bhavnani2-May-02 8:32 
GeneralRe: I NEED HELP!!! Pin
Donna2-May-02 8:39
Donna2-May-02 8:39 
GeneralRe: I NEED HELP!!! Pin
Maximilien2-May-02 9:44
Maximilien2-May-02 9:44 
GeneralRe: I NEED HELP!!! Pin
Donna2-May-02 9:52
Donna2-May-02 9:52 
GeneralRe: I NEED HELP!!! Pin
Maximilien2-May-02 11:08
Maximilien2-May-02 11:08 
GeneralRe: I NEED HELP!!! Pin
Maximilien2-May-02 11:09
Maximilien2-May-02 11:09 
GeneralRe: I NEED HELP!!! Pin
Christian Graus2-May-02 12:27
protectorChristian Graus2-May-02 12:27 
GeneralRe: I NEED HELP!!! Pin
Christian Graus2-May-02 12:26
protectorChristian Graus2-May-02 12:26 
GeneralRe: I NEED HELP!!! Pin
Maxwell Chen2-May-02 19:37
Maxwell Chen2-May-02 19:37 
GeneralRe: I NEED HELP!!! Pin
Donna3-May-02 18:07
Donna3-May-02 18:07 
GeneralRe: I NEED HELP!!! Pin
Christian Graus3-May-02 18:19
protectorChristian Graus3-May-02 18:19 
GeneralThe escape sequence in HTML. Pin
Maxwell Chen3-May-02 22:26
Maxwell Chen3-May-02 22:26 
GeneralDDEML Pin
Valeria2-May-02 8:08
Valeria2-May-02 8:08 
GeneralRe: DDEML Pin
Tim Smith2-May-02 8:19
Tim Smith2-May-02 8:19 
GeneralRe: DDEML Pin
Valeria2-May-02 9:34
Valeria2-May-02 9:34 
QuestionHow do you load a bitmap? Pin
atomicluis2-May-02 7:58
atomicluis2-May-02 7:58 
AnswerRe: How do you load a bitmap? Pin
Philip Patrick2-May-02 10:20
professionalPhilip Patrick2-May-02 10:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.