can u give me an example of a program like this?
write a program that allows the user to play the game called the secret number with the comp. the user will try to guess the secret number, a number known only by the comp. this secret number is an integer value and lies between 0 and 100. if the user input number is not the secret number, then the computer will return a refined range containing the secret number. given the refined range, the user will try to guess the number again. the secret number can be generated by using a random number generator. u may use the function rand()%101 to generate a random number between 0 and 100. the seed for this number generator is given as srand(((unsigned)time(NULL)).
are_nice
0
Newbie Poster
Recommended Answers
Jump to PostThat's a fun assignment. How much code have you done?
Jump to PostYour post describes each step perfectly. Computer generates a number, user makes a guess, computer tells what range the number it is in, and so on. If you're problem is writing the code, learn some c++ first.
All 5 Replies
Comatose
290
Taboo Programmer
Team Colleague
death_oclock
103
Posting Whiz
are_nice
0
Newbie Poster
death_oclock
103
Posting Whiz
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
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.