Read the code below and answer the following questions Write

Read the code below and answer the following questions: Write a cout statement that uses the ptr variable to display the contents of the y variable. What will be displayed if you send the expression *iptr to cout? What happens if you send the expression iptr to cout? Assuming that soap is an instance of the Inventory class, which of the following below is a valid call to the setOnHand member function. setOnHand (20); soap:: setOnHand (20); soap. setOnHand (20); Inventory. setOnHand(20); The following program contains errors. Find as many as possible.

Solution

a) cout<<*ptr;
b) cout<<*iptr; Output-> 7
c) cout<<iptr; Output-> HEXADECIMAL ADDRESS OF x
d) C) soap.setOnHand(20);
e)
class circle
{
private:
   double centerX;
   double center;
   double radius;
public:
   void SetCenter(double,double);
   void SetRadius(double);
};

 Read the code below and answer the following questions: Write a cout statement that uses the ptr variable to display the contents of the y variable. What will

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site