View Poll Results: so how is it
- Voters
- 1. You may not vote on this poll
-
make it smooth
-
keep it smooth
-
Nov 26th, 2002, 11:12 AM
#1
Thread Starter
New Member
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;
}
-
Nov 29th, 2002, 02:55 PM
#2
Addicted Member
why do people try to get others to do their homework for them?
Soylent Green tastes like chicken
-
Nov 29th, 2002, 04:01 PM
#3
Frenzied Member
Dont gain the world and lose your soul
-
Dec 5th, 2002, 10:36 AM
#4
Thread Starter
New Member
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.
-
Dec 5th, 2002, 12:01 PM
#5
yay gay
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/
-
Dec 5th, 2002, 01:37 PM
#6
Thread Starter
New Member
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!!!
-
Dec 5th, 2002, 02:27 PM
#7
Addicted Member
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?
-
Dec 5th, 2002, 02:45 PM
#8
Member
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~~
-
Dec 5th, 2002, 03:04 PM
#9
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|