Thread: Umm.. yeah me again askin for help...

  1. #1
    Silent Wolf
    Guest

    Unhappy Umm.. yeah me again askin for help...

    Ok... I guess Rob thinks i'm stupid or something... anyways.. the reason I need it is because I have to spend the whole period working on my other problems out of the book and I need the extra credit i would get out of this. The class is a major headache.. guess that's why i'm the only female in it. She said we should ask around online for the code for this because we haven't worked yet with getting the computer to pick a number.

    Oh yeah and if anyone is actually willing to help, I'd need it written so it could go into the Microsoft C++ programing software.

    Thanks again...

  2. #2
    His posts are far and few Esparno's Avatar
    Join Date
    Mar 2002
    Posts
    100
    Did my other code not work? try this code.


    #include <iostream.h>
    int main(0)
    {
    float game1, choice1;

    game1=int(rand*100+1); //Makes a random number between 0 and 100

    A: //Label A
    cout<<"Guess\n?";
    cin>>choice1;
    if (game1==choice1)
    {
    cout<<"You win";
    return(0);
    }
    if else (choice1<game1)
    cout<<"\nTo Low\n";
    else

    if else (choice1>game1)
    cout<<"\nTo High\n";

    goto A;
    }
    Signature is optional, I didnt opt for one.

  3. #3
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    Ok... I guess Rob thinks i'm stupid or something
    Not at all. You'll have to excuse the blunt cynisism(sp) in my reply, but folks are more willing to help if you make part of the effort yourself. Post what you've done so far, even if it's only a skeleton.

    What gets peoples back up is being asked to do all the work for you. After all, it's you who's gonna be marked on it - so it should be your work.

    Good luck.
    Visit entropysink.com - It's what your PC is made for!

  4. #4
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    /me smacks Esparno

    I will smack you again everytime I see you using goto.

  5. #5
    His posts are far and few Esparno's Avatar
    Join Date
    Mar 2002
    Posts
    100
    PHP Code:
    HAHA:
    cout<<"\nHAHA I WILL USE GOTO 4 EVER!!!";
    goto 
    HAHA
    Signature is optional, I didnt opt for one.

  6. #6
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    there'll be no EVER...

    didn't you GOTO the link vVv gave in your thread
    -

  7. #7
    Registered User biosx's Avatar
    Join Date
    Aug 2001
    Posts
    230
    goto..

  8. #8
    Registered User biosx's Avatar
    Join Date
    Aug 2001
    Posts
    230
    Esparno, did you even see what you were typing? lol
    Esparno's code
    if else (choice1<game1)
    Here is Esparno's code, but fixed for structured programming (plus the syntax is right for this one).
    Code:
    #include <iostream.h>
    #include <stdlib.h> 
    #include <time.h>
    
    int main() 
    { 
       float game1, choice1; 
    
       srand( time(NULL) );
       game1= rand() % 100;
    
       do {
          cout << "Guess:> "; 
          cin >> choice1; 
       
          if (game1 == choice1) 
             cout << "You win!" << endl; 
          else if (choice1 < game1) 
             cout <<"To Low" << endl; 
          else if (choice1 > game1) 
             cout<<"To High" << endl; 
       } while( game1 != choice1);
    
       return 0;
    }
    Last edited by biosx; 03-20-2002 at 11:51 AM.

  9. #9
    Silent Wolf
    Guest

    Talking

    LOL you guys are crazy. Thanks for the help i'm at home now i'll try the programs you posted tomorrow in class. Thanks again!

Popular pages Recent additions subscribe to a feed