I have to write a program that allows a user to pick five numbers from one to 55. The computer will then generate 5 random numbers and determine how many of the users choices match the generated numbers. I have to create an algorithm for this program. The program will have a void function to generate 5 random numbers from one to 55, no duplicate numbers allowed. The random numbers and the choices will be stored in two one dimensional arrays. The program will have a void function to display the random
numbers and the users choices and the number of matches. The program will contain a loop that will generate a new set of random numbers and user choices unless the user tells the program to quit. I don't even know where to start with this. The void function is what I'm not getting mostly.
vinochick 0 Newbie Poster
Recommended Answers
Jump to PostHere is a possible pseudo-code for what ye' wish to accomplish:
1. Prompt the user for 5 numbers:
do{ cout << "Enter a number: "; cin >> user_picks[i]; i++; }while(i<5);
2. Ensure that user did not make a duplicate pick:
do{ cout << …
All 4 Replies
sfuo 111 Practically a Master Poster
Clinton Portis 211 Practically a Posting Shark
vinochick 0 Newbie Poster
pecet 1 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.