Question
C++ Only Consider the following code and answer the questions: class myClass { public: void set(int x, int y); //Function to set the values of
C++ Only
- Consider the following code and answer the questions:
class myClass { public: void set(int x, int y); //Function to set the values of num1 and num2. //Postcondition: num1 = x; num2 = y; void print() const; //Function to output the values of num1 and num2; int compute( int x); //Function to return a value as follow; //if x > 0, retunr (num1 + num2) / x; //Otherwise, return num1 - num2 + x; bool equal() { return (num1 == num2); } myClass() { myClass(int x, inty); } private: int num1 = 0; int num2 = 0; };
- Which member functions of the class myClass are inline.
- The definitions of the member function of the class myClass which are not inline.
- A program to test the class myClass.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started