View Poll Results: so how is it

Voters
1. You may not vote on this poll
  • make it smooth

    0 0%
  • keep it smooth

    1 100.00%
Results 1 to 9 of 9

Thread: help me

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Location
    middle of the country
    Posts
    8

    Thumbs up help me

    will some one please fix this program and send it to me at <href mailto:iwi****[email protected]/h>



    #include <iostream.h> //reference to cout


    //Stack class code goes here
    // The book would probably provide a valuable reference for a stack..
    class Stack
    {
    Stack()
    {
    cout << "\n If you are seeing this, you have not implemented a stack\n";
    }


    };

    /**
    * My postfix notation calculator does ...
    *
    */
    class PostFixCalculator
    {
    public:

    PostFixCalculator();
    PostFixCalculator(int operand1, int operand2, char op);

    /**
    * Return the top element of the stack but do not remove it.
    */
    int view();


    /**
    * Add an operand to the stack
    */
    void add(int );

    /**
    * Execute the operator on the top two elements of the
    * stack. Push the results back onto the stack and
    * return the same value.
    */
    int add(char);

    private:
    Stack operand;
    };


    //Implement code here



    int main(int argc, char * argv[])
    {
    const char plus = '+', minus = '-', divide = '/', multiply = '*',
    mod = '%';
    PostFixCalculator p;
    PostFixCalculator c(5, 5, multiply);
    PostFixCalculator p2;
    p.add(5);
    p.add(5);
    p.add(7);
    p.add(0);
    p.add(plus);
    p.add(minus);
    p.add(multiply);

    p2.add(7);
    p2.add(3);
    p2.add(mod); //p2.view should be equal to 1
    p2.add(16);
    p2.add(plus); //p2.view should be equal to 17
    p2.add(0);
    p2.add(10);
    p2.add(3);
    p2.add(1);
    p2.add(52);
    p2.add(37);
    p2.add(1);
    p2.add(6);
    p2.add(548);
    p2.add(multiply); //p2.view should be 3288
    p2.add(multiply); //p2.view should be 3288
    p2.add(mod); //p2.view should be 37
    p2.add(multiply); //p2.view should be 1924
    p2.add(multiply); //p2.view should be 1924
    p2.add(multiply); //p2.view should be 5772
    p2.add(mod); //p2.view should be 10
    p2.add(multiply); //p2.view should be 0
    p2.add(plus); //p2.view should be 17
    p2.add(0);
    p2.add(minus); //p2.view should be 17

    if (p.view() == -10)
    cout << "Things are going well for you \n";
    else
    cout << "Something's wrong with your code\n";

    if (c.view() == 25)
    cout << "Excellent \n";
    else
    cout << "Something's wrong with your non-default constructor \n";

    if (c.view() == 17)
    cout << "Fantastic work \n";
    else
    cout <<"Looks like something's amiss\n";

    return 0;
    }

  2. #2
    Addicted Member Halon's Avatar
    Join Date
    Oct 2002
    Location
    under desk choking on rage
    Posts
    228
    why do people try to get others to do their homework for them?
    Soylent Green tastes like chicken

  3. #3
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    LOL
    Dont gain the world and lose your soul

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Location
    middle of the country
    Posts
    8

    not cool

    hey the only damn reason I am doing this for this work is because my knowledge of the subject matter (programing), really sucks. I NEED THE GRADE, WILL SOMONE PLEASE JUST HELP.

  5. #5
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    omg i wont help a guy who just doesnt know the difference between ++ and #..this is a C# forum not a C++ FORUM!

    and why da hell do u want us to make that to u? next year instead of u wanting us to make 100 lines u want 1000..and that would be unfair to ur colleagues
    \m/\m/

  6. #6

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Location
    middle of the country
    Posts
    8

    oops.

    I didn't relize, or even think about C# being different from any C or C++, but i did a little research after reading ur reply, My Bad!

    And by the way I missed like 2 months of school because of a bad car wreck and I missed so much damn programing class I got screwed. Now all I am tring to do is get a passing grade so I dont get booted out of this college and worse kicked out of home. I wouldn't use this method of gaining a grade if it wasn't my very last hope.

    Anyway I still relize I'm in the wrong forum but if anyone knows

    C++ and they want to still help im in desperate need!!!

  7. #7
    Addicted Member MasterBlaster's Avatar
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    196
    Get some cash and buy it off of someone who took the class last semester. Damn, You havn't figured out how school works yet have you?

  8. #8
    Member
    Join Date
    Nov 2002
    Posts
    42
    No doubt we will never see this dude again if he egts what he wants.

    I am a student, who has asked ont he odd occasion for some help from people who know what they are doing, and i try to help out if i can.

    ~~Those who hand the work in have looked, those who dont get an extension~~

  9. #9
    Addicted Member Halon's Avatar
    Join Date
    Oct 2002
    Location
    under desk choking on rage
    Posts
    228
    No doubt..I did my time in school, banged my head till I can still hear the ringing and asked for lots of help from classmates (didn't have a clue what a forum was back then). I'll help anyone with a question I can answer (i know i've been helped a lot here on these forums). But to simply post a homework assignment and just ask us to 'fix' it and email it to him is ridiculous.
    Hope I don't sound like an insensitive jerk but it ****es me off
    Soylent Green tastes like chicken

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width