0
public:
        Mixed(int whole = 0);
        Mixed(int whole, int num, int denom);

        bool SetFraction(int n, int d);

        
        bool SetFraction(int n, int d=1);
        bool SetValue(int w, int n, int d);

        int getWhole();

        int getNumerator();
        int getDenominator();
        void showFraction();

        double Evaluate();
        void Simplify();
        void ToFraction();

        Mixed& operator++();      //prefix increment
        Mixed operator++(int);      //postfix increment
        Mixed& operator--();      //prefix decrement
        Mixed operator--(int);    //postfix decrement
        


    private:
        int wholeNumber;
        int numerator;
        int denominator;

        int gcd(int, int);

};
bool Mixed::SetValue(int w, int n, int d)
{ 
   if (w==0)
   {
        wholeNumber = 0;
        if (SetValue(w, n, d) == false)
	        SetFraction(0, 1);
	    return true;
   }
   else if (w < 0 && SetFraction(n,d) == false)
   {
        wholeNumber = 0;
        SetFraction(0, 1);          
        return true;
   }
   else if (w < 0)
   {
        wholeNumber = w;
        if (SetFraction(n, d) == false)
            SetFraction(0, 1);
        return true;
   }
   else if ( SetFraction(n,d) == false)
   {
        wholeNumber = 0;
        SetFraction(0,1);
        return true;
   }
   wholeNumber = w;
   SetFraction(n,d);
   return true;
}



bool Mixed::SetFraction(int n, int d)
{
    if (d <= 0)
	return false;

   numerator = n;
   denominator = d;
   return true;
}

Please help! It says function SetFraction is not in scope within function SetValue?

1
Contributor
1
Reply
3
Views
5 Years
Discussion Span
Last Post by dekker13
0

Fixed the issue. If anyone looked at this thank you for your time.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.