PLEASETRACE BY HAND OR SHOW WHAT EACH VALUE IS ASSIGNED TO and SHOW the OUTPUT for the following code:
THE USER INPUT IS: 87 45 for the CODE THAT FOLLOWS:
#include
usingnamespace std;
class twoNums
{
public:
void setOne (int); // sets the private member one to the value of the parameter
void setTwo (int); // sets the private member two to the value of the parameter
void nicePrint(); // prints the values of the both private members,onefirst followed bytwo,
// with 2 blank-spaces between then moves to a new line
private:
int one;
int two;
};
int main( )
{cout"==========\n";
twoNums*ptr;
intnumONE, numTWO;
ptr =newtwoNums;
ptr->setOne(numTWO);
ptr->setTwo(numONE);
ptr->nicePrint();
cout"Please input two numbers separated by a space."endl;
cin>>numTWO>>numONE;
system (“Pause”);
return 0; }
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here