NPTEL( 14 Sep - 06 Nov ) | Week 3 Programming Qs3 and Programming Qs4 Programming in CPP 2020

 




       Programming in C++       



W3_Programming-Qs 3:


Consider the following program and fill in the blanks at LINE-1, LINE-2, LINE-3 with appropriate
initialization of data-members such that it satisfies the given test cases.

PROGRAM:

public:
    Complex() : _r(0),_i(0) { }                       // LINE-1

    Complex(int r) : _r(r),_i(0) { }                  // LINE-2

    Complex(int r, int i) : _r(r),_i(i) { }           // LINE-3


W3_Programming-Qs 4:


Fill in the blanks as instructed to declare and define appropriate objects 
so that the program generates the output as per the given test cases.

PROGRAM:

  integer objA;  // LINE-1: Invoke Default Constructor

   integer objB(val);  // LINE-2: Invoke Parameterized Constructor

    integer objC=objB;  // LINE-3: Invoke Copy Constructor
 
  FOLLOW OUR WEBSITE FROM THE BUTTON PROVIDED TO THE BOTTOM OF PAGE TO GET SOON ANSWERS OF PROGRAMS.
Disclaimer: Here you can find all nptel assignment solutions related to CS stream.These may help you for your assignment.The answers are only for verification.You cannot copy these directly from the post(code of conduct of NPTEL).These is not 100%  correct solutions.

No comments:

Post a Comment

If you have any problems related to solutions or any concept please let me know.

Copyright (c) 2020 Custom Programs All Right Reserved

Pages