A question for my class HELP!!!!!

This is a discussion on A question for my class HELP!!!!! within the C++ Programming forums, part of the General Programming Boards category; Need to know how to do this program an possible answer to this question: Using your high-low program. Add code ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    1

    Lightbulb A question for my class HELP!!!!!

    Need to know how to do this program an possible answer to this question:

    Using your high-low program. Add code that allows the computer to pick a random number and the user to guess the number.

    If you could please send this to my email address i would appreciate it very much. Thanks for your time

  2. #2
    His posts are far and few Esparno's Avatar
    Join Date
    Mar 2002
    Posts
    100
    #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;
    }



    This should work, I dont know, i dont have a compiler at school...
    Last edited by Esparno; 03-19-2002 at 10:58 AM.
    Signature is optional, I didnt opt for one.

  3. #3
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    You want us to do your coding for you??

    why dont you try something and then if you get errors ask us. Theres always somebody to help others.

    edit:
    well, esparno beat me to it. damn my typing speed sucks
    Last edited by ihsir; 03-19-2002 at 10:59 AM.
    -

  4. #4
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    605
    This should get you top marks!!!

    #include <iostream.h>
    int (a);
    int main(void)

    {
    cout << "Enter a number" << endl;
    cin >> a;
    cout << "No, guess again" <<endl;
    return 0;
    }

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

  5. #5
    His posts are far and few Esparno's Avatar
    Join Date
    Mar 2002
    Posts
    100
    lol, great signature Rob
    Signature is optional, I didnt opt for one.

  6. #6
    Silent Wolf
    Guest

    Unhappy

    Welll.... I'd need the code to go into a microsoft coder.... if anyone knows how to do that please help me. It's just that I have all this other stuff piled up on me an I really need help with this because it's extra credit. Sheesh maybe now I understand why i'm the only female in this class ;P

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 02:03 AM
  2. Replies: 8
    Last Post: 10-02-2005, 01:27 AM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  4. question about DLL's and class functions
    By btq in forum Windows Programming
    Replies: 2
    Last Post: 02-25-2003, 06:08 AM
  5. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 07:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21