- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
program does not return the value entered #include <iostream> using namespace std; class testClass { public: int sum(); void print() const; testClass(); testClass(int a, int b); private: int x; int y; }; int testClass::sum() { int c; c = x + y; return c; } void testClass::print() const { cout … |
|
the values are not being passed correctly, in my constructor i copy the value of d to decimalNum and the value of b to base. when i run the program the values are 0. what am i doing wrong?: baseType::baseType(int b, int d) { base = b; decimalNum = d; … |
|
write a recursive function to convert a number in decimal to a given base b, where b is between 2 and 36. so far converts between 2 and 16 what must be added to convert between 2 and 36? [code]#include <iostream> using namespace std; void toBase(int n, int base) { … |
|
i have the following for my operator overload [code]fraction fraction::operator+(const fraction& object)const { fraction temp; temp.a = a*object.b + b*object.a; temp.b = b * object.b; return temp; } fraction fraction::operator-(const fraction& object) const { fraction temp; temp.a = a*object.b - b*object.a; temp.b = b * object.b; return temp; } fraction … |
|
I have the following assignment due: Design a class -say, fraction - that performs the arithmetic and relational operations on fractions. Overload the arithmetic and relational operators so that the appropriate symbols can be used to perform the operation. Also, overload the stream insertion and stream extraction operators for easy … |
|
can someone help me with this, or just help get me started. write the definitions of the functions to overload the increment, decrement, arithmetic, and relational operators as a member of the class rectangeType. write a test program that tests various operations on the class rectangleType |