By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,620 Members | 1,512 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,620 IT Pros & Developers. It's quick & easy.

Guess Program

P: 1
I am supposed to create a program use c++ that generates a random number and then asks the user to guess the number (1-10). The program tells the user if he guessed too high or too low and still run until find correct answer. If he guessed right, it asks the user is he/she wants to play again. If the answer is yes, it generates a random number and asks the user to guess the number again. The user can exit if he enters 0. I have created the following code so far but it does not work. I would appreciate any help.
Feb 28 '07 #1
Share this Question
Share on Google+
3 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
I am supposed to create a program use c++ that generates a random number and then asks the user to guess the number (1-10). The program tells the user if he guessed too high or too low and still run until find correct answer. If he guessed right, it asks the user is he/she wants to play again. If the answer is yes, it generates a random number and asks the user to guess the number again. The user can exit if he enters 0. I have created the following code so far but it does not work. I would appreciate any help.
I cannot see your code (it might be my browser), can you post it again?
Feb 28 '07 #2

DeMan
100+
P: 1,806
Think about what you want to do. There is much information ion the paragraph you have included. Try to work out a process, refining into smaller steps.... Once you have worked out a basic flow for the program, then we can start thinking about coding. Hopefully by working out the flow, you will have simplified the problem sufficiently to make a start with the actual coding.

Post again, by all means, if you get stuck, but please try to be specific about exactly what the difficulty is, and how it was encountered. You won't find complete solutions here, but you will find a lot of help on the way to formulating your own.
Feb 28 '07 #3

Savage
Expert 100+
P: 1,764
I am supposed to create a program use c++ that generates a random number and then asks the user to guess the number (1-10). The program tells the user if he guessed too high or too low and still run until find correct answer. If he guessed right, it asks the user is he/she wants to play again. If the answer is yes, it generates a random number and asks the user to guess the number again. The user can exit if he enters 0. I have created the following code so far but it does not work. I would appreciate any help.
Maybe,this can help out:

<MODERATOR: Code has been removed as per our FAQ>
Feb 28 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.