473,326 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Guess Program

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
3 1606
sicarie
4,677 Expert Mod 4TB
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
1,806 1GB
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
1,764 Expert 1GB
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

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

Similar topics

1
by: sunaina | last post by:
This is the first program I am writing using PHP and Mysql. I am creating a game where user thinks of an object and my program guesses the object while asking series of yes/no questions. All a...
22
by: JavaJunkie | last post by:
When I got the following posting on Monster.com I almost puked. See http://jobsearch.monster.com/getjob.asp?JobID=20663147 They want candidates from IIT (Indian Institute of Technology) / REC...
8
by: EAS | last post by:
Hey, I'm new to python (and programming in general) so I'll prolly be around here a lot... Anyways, I've found out how to make a "guess my number game" where the player guesses a number between...
137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
16
by: silversurfer2025 | last post by:
Hello everyone, once again, I have a very basic problem in C++, which I was not able to solve (maybe because of my Java-Experience or just because it is always the small syntax-things which break...
2
by: d0ugg | last post by:
Hi, I'm starting to learn C++. And I have this assignment and I can't compile it for some reason.. Here is the problem: -> Write a number guessing name program named guess. The program will...
3
by: cathf | last post by:
I am working on a program where the user guesses a random number generated in VB. The numbers entered by the user must be within the range 1 to 20, so the program has been validated. All valid...
3
by: willkab6 | last post by:
I am very new to both programming and Pyhton and while trying to do some practice using A byte of python an Error pops up on the IDLE shell. I am using windows XP. PLease see below. while running:...
2
by: realNewbie | last post by:
I am trying to duplicate the Guess My Number Game from Python Programming for the Absolute Beginner by Michael Dawson but for some reason I still cannot figure out my output is not completely...
3
by: bravoss | last post by:
First of all helo to everyone. I'm new to this forum and I'm also new to C++. I'm in first year of university and we have programming lectures from C++. We had a test today and I couldn't design one...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.