Tuesday, February 11, 2020

PROGRAMMING IN C++ WEEK 3

HELLO!! FRIENDS HERE I HAVE PASTED ONLY THE SOLUTION AND NOT THE COMPLETE PROGRAM SO PASTE IT CAREFULLY IN YOUR SOLUTION.

QUESTION 1:

mutable int bill;                  // LINE-1

public:
    Customer(int _cust_id, string _name, int _bill)
        : cust_id(_cust_id), name(_name), bill(_bill) {}

    void changeBill(int s)const {    // LINE-2

        bill = s;
    }

    void display()const {            // LINE-3 

QUESTION 2:

public:
Point(int _x, int _y) : x(_x), y(_y){} 

// Copy constructor 
Point( const Point& p2 ) : x( p2.x*10 ), y( p2.y*10 ){} 

QUESTION 3:

class Point {
    mutable int x;    // LINE-1

    mutable int y;    // LINE-2
public:
    Point(int _x, int _y) : x(_x), y(_y){}

    void changePoint(int _x, int _y)const {    // LINE-3

        x = _x;
        y = _y;
    }

    void showPoint()const {    // LINE-4

QUESTION 4:

// LINE-1: define parametrized constructor 
Rectangle::Rectangle(int _h, int _w)
{
  hp=&_h;
  wp=&_w;
}


// LINE-2: define destructor
Rectangle::~Rectangle()
{
  
}

// LINE-3 define function area()
int Rectangle::area()
{
  int a;
  a=(*hp)*(*wp);
  return a;
}

2 comments:

  1. Do you understand there is a 12 word sentence you can speak to your partner... that will induce intense emotions of love and impulsive attraction for you buried inside his chest?

    Because deep inside these 12 words is a "secret signal" that triggers a man's impulse to love, treasure and protect you with his entire heart...

    12 Words Who Fuel A Man's Desire Impulse

    This impulse is so built-in to a man's brain that it will make him try harder than before to to be the best lover he can be.

    As a matter of fact, fueling this powerful impulse is absolutely mandatory to getting the best possible relationship with your man that as soon as you send your man a "Secret Signal"...

    ...You will soon notice him open his heart and mind for you in such a way he never experienced before and he'll perceive you as the one and only woman in the universe who has ever truly attracted him.

    ReplyDelete