Programming In Modern C++ Assignment 3 Answers 2022

Programming In Modern C++ Assignment 3 Answers 2022:-All the Answers provided below to help the students as a reference, You must submit your assignment at your own knowledge.

NPTEL Programming In Modern C++ Assignment 3 Answers 2022

1. Identify set of all methods that change the state of Complex class objects?

a) setRE(), setIM(), print ()
b) setRE(), setIM), incrRE(), incrIM()
c) incr(), incrRE(), incrIM()
d) setRE(), setIM(), incr (), incrIM()

Answer:- d

2. What will be the output?

a) 0 1 0 2
b) o 1 2
c) 0 2 3
d) 1 2

Answer:- d

Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW

Programming In Modern C++ Assignment 3 Answers 2022

3. Fill in the blank at LINE-1 such that the program will print in C++ programming

a) *s2, *s3, *s1
b) *s1, *s2, +s3
c)*s1, *s3, *s2
d) *s2, *s1, *s3

Answer:- a

4. What will be the output/error?

a) 0
b) 5 5
c) Compiler error: assignment of data-member Test::t is read-only object
d)Compiler error: cannot have const function for non-const object

Answer:- c

5. What will be the output/error?

a) 10+ i20
b) 20+ i50
c) Compiler Error: lvalue required as left operand of assignment
d) Compiler Error: private x, y are inaccessible

Answer:- c

6. What is the type of this pointer associated with the object m?

a) const myClass* this;
b) myClass* const this;
c) myClass const+ const this;
d) const myClass* const this;

Answer:- c, d

Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW

Programming In Modern C++ Assignment 3 Answers 2022

7. What will be the output?

a) OKKK
b) OKZZ
c) OKKZ
d) 0zzz

Answer:- b

8. Fill in the blank at LINE-1 such that the program will print D.

a) +this>x
b) +this.x
c) t+x
d) xt+

Answer:- a, c

9. What will be the output?

a) 5665
b) 555
c) 665
d) 6565

Answer:- c

For More NPTEL Answers:- CLICK HERE

Join Our Telegram:- CLICK HERE

About Programming In Modern C++

There has been a continual debate on which programming language/s to learn, to use. As the latest TIOBE Programming Community Index for August 2021 indicates – C (13%), Python (12%), C++ (7%), Java (10%), and C#(5%) together control nearly half the programming activities worldwide. Further, C Programming Language Family (C, C++, C#, Objective C etc.) dominate more than 25% of activities. Hence, learning C++ is important as one learns about the entire family, about Object-Oriented Programming and gets a solid foundation to also migrate to Java and Python as needed. C++ is the mother of most general purpose of languages. It is multi-paradigm encompassing procedural, object-oriented, generic, and even functional programming. C++ has primarily been the systems language till C++03 which punches efficiency of the code with the efficacy of OOP.

Then, why should I learn it if my primary focus is on applications? This is where the recent updates of C++, namely, C++11 and several later offer excellent depths and flexibility for C++ that no language can match. These extensions attempt to alleviate some of the long-standing shortcomings for C++ including porous resource management, error-prone pointer handling, expression semantics, and better readability. The present course builds up on the knowledge of C programming and basic data structure (array, list, stack, queue etc.) to create a strong familiarity with C++98 / C++03. Besides the constructs, syntax and semantics of C++ (over C), we also focus on various idioms of C++ and attempt to go to depth with every C++ feature justifying and illustrating them with several examples and assignment problems. On the way, we illustrate various OOP concepts. The course also covers important advances in C++11 and later released features.

COURSE LAYOUT

  • Week 1: Programming in C++ is Fun.
  • Week 2: C++ as Better C.
  • Week 3: OOP in C++.
  • Week 4: OOP in C++.
  • Week 5: Inheritance.
  • Week 6: Polymorphism.
  • Week 7: Type Casting.
  • Week 8: Exceptions and Templates.
  • Week 9: Streams and STL.
  • Week 10: Modern C++.
  • Week 11: Lambda and Concurrency.
  • Week 12: Move, Rvalue and STL Containers.

CRITERIA TO GET A CERTIFICATE

Average assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course.
Exam score = 75% of the proctored certification exam score out of 100

Final score = Average assignment score + Exam score

YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met, you will not get the certificate even if the Final score >= 40/100.


Leave a Comment