Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please correct my code, using comment // to explain what my wrong. So, i can und

ID: 3540447 • Letter: P

Question

Please correct my code, using comment // to explain what my wrong.
So, i can understand my wrong.

Thank.


My code:


#include <iostream>

using namespace std;

class NUMBERS
{
    private:
            int x, y;

    public:
            NUMBERS()
            {

            }

            NUMBERS(const NUMBERS &rc)
            {

            }

            void setinput(int a1,int a2)
            {

                x=a1;
                y=a2;

            }

            friend int addition(NUMBERS ptr);
            friend int subtract(NUMBERS ptr);
            friend int max_min(NUMBERS object);

};

int addition(NUMBERS cc)
{

    return (cc.x+cc.y);

}

int subtract(NUMBERS cc)
{

    return (cc.x*cc.y);

}

int max_min()
{



}


int main()
{
    int a, b;
    int add, sub;

    NUMBERS object;

    cout<<"Get value of x: ";
    cin>>a;

    cout<<"Get Value of y: ";
    cin>>b;

    object.setinput(a,b);

    add=addition(object);
    sub=subtract(object);

    cout<<"Addition of x and y : "<<add<<endl;
    cout<<"Subtraction of x and y : "<<sub<<endl;

    NUMBERS object2;

    NUMBERS newobj1=object2;

    return 0;
}

Create a class called NUMBERS Data members x and y of type integer. Member functions: In main() function

Explanation / Answer


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote