Guestbook

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

62 Comments

Reply ginstt
12:01 PM on September 23, 2011 
I need to write a program where the user has to guess the random number that the program makes up. The range is between 0 - 100 and the user only gets 10 tries to guess the number. If the number is too high or too low, it informs the user by saying that the random number is lower or higher.

I'm still learning Java and C++ is very new to me, even though most of the stuff is similar. The program that I have written compiles and runs, but it doesn't seem to reach the steps that tell the user whether the number the entered is higher or lower than the random number. This is my first time using nested if's and I probably have them ordered in a way where they aren't being read.

Can anyone point me in the right direction so my program will follow through with the right step at the right time?

Here is my code:

#include <iostream>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>

int main ()

int usersGuess;
int usersChances = 0;
int secretInt;

int MAX_VALUE = 100 + 1;
int MIN_VALUE = 0;

srand ( time(NULL) );

secretInt = rand() % 100 + 1;

while ( (usersGuess != secretInt) && (usersChances <= 9) )

cout << "The secret number is between 1 and 100.\n"
<< "What is your guess? ";
cin >> usersGuess;

usersChances++;

if ( usersGuess > MAX_VALUE && usersGuess > MIN_VALUE )

if ( usersGuess == secretInt )

cout << "Right! It took you " << usersChances << " guesses.";
break;

if ( usersGuess < secretInt )

cout << "Too low, guess again? ";
usersChances++;

if ( usersGuess > secretInt )

cout << "Too high, guess again? ";
usersChances++;

cout << "Invalid guess, guess again? ";




Tips or suggestions are greatly appreciated. Thank you!
Reply baxPariPhadia
01:44 PM on September 22, 2011 
Demotivators called pictures , which consist of images of prisoners in the frame, with the preparation of labels, commenting on the image . Pictures demotivators strictly match the aspect parameters.At the present time demotivators jokes are the most popular form for the opportunity to express their own attitude to a particular event happening directly around us .It is valid to ask what use can demotivators so widely known, having an identical form of well-known poster campaign messages and appeals in order to present information to people? However, propaganda posters , and their revolutionary appeals coincide with the real situation .So they can not rely on positive feedback , their objectives do not provide positive results. And it's finally fed up with many ... So here and got their distribution demotivators .Now the World Wide Web there are some resources to create demotivators that allow greatly simplify this process and make it as enjoyable as possible .But there may be some difficulties , especially when creating demotivators , this process is always accompanied by an attachment site logo , which had carried out new demotivators .This fact leads to devaluation of the image, losing the original meaning demotivators , for here is completely lost authorship , no one will know who created this masterpiece . Therefore, a different approach was devised to address this issue - the creation of demotivators using a graphical editor for creating your unique image with the words .
Reply Svenja
01:05 PM on February 09, 2011 
Love this homepage, u've done a great job so far!
Maybe u wanna visit my international forum. It's only new and needs some pinkies to fill it with news and laughter ;)

www.inofficialpink.de
Reply Keggy
06:35 AM on December 31, 2010 
Hi just to say 'HAPPY NEW YEAR' from myself and my family to all Pink fans out there x x x x
Reply care.in
12:23 PM on November 02, 2010 
hello from switzerland! thanks for ur shows during winter and summer! especially the show on salem castle - one day after P!NKs stage crash in nuremberg!u were all TOP!
love u guys - keep on rockin'

care.in

ps.:some pics on "P!NK on salem castle germany"
Reply ChiChiMarie
05:19 PM on October 29, 2010 
Thank you. We try very hard! Xx

kelliefer says...
This is awesome!
Reply kelliefer
05:01 PM on October 29, 2010 
This is awesome!
Reply paula dowling
11:25 AM on October 12, 2010 
big thankyou to you all who makes every show spectacular a lot of hard work goes into each show an it is worth a look even if ya not a pink fan because once you see a pink show you will be ,and a big thankyou to all involved in this great website for all us pink fans it is the best site to catch anything you want to catch up on thanx to ya all
Reply ChiChiMarie
10:36 AM on October 02, 2010 
Thanks! We try our hardest! xx

Doris says...
Hey! :D

Thanks for the cool PinkFanSite!! I Love IT!!

some love from Vienna... love ya... :D
Reply Doris
04:44 PM on September 22, 2010 
Hey! :D

Thanks for the cool PinkFanSite!! I Love IT!!

some love from Vienna... love ya... :D

 

 

Upcoming Events

Friday, Feb 17 All Day
Tuesday, Feb 21 All Day
Monday, Feb 27 All Day
Saturday, Mar 3 All Day

Recent Videos

593 views - 0 comments
478 views - 0 comments

Site Visits