NPTEL Programming in Modern C++ Assignment 5 Answers 2022

NPTEL Programming in Modern C++ Assignment 5

Are you looking for the Answers to NPTEL Programming in Modern C++ Assignment 5? This article will help you with the answer to the National Programme on Technology Enhanced Learning (NPTEL) Course Programming in Modern C++ Assignment 5

Join Our Official Telegram Channel

What is 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.

CRITERIA TO GET A CERTIFICATE

Average assignment score = 25% of the 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 THE 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.

Below you can find the answers for NPTEL Programming in Modern C++ Assignment 5

NPTEL Programming in Modern C++ Assignment 5 Answers:-

Q1. Consider the following program. Fill in the blanks as per the instructions given below:

• at LINE-1 with appropriate initialization list to initialize the data members,• at LINE-2 to call printContact(),

          : roll_no(roll_no_),name(name_),Contact(phone_no_,address_){}    //LINE-1

void printContact(){

    Contact::printContact();

}   //LIN

Q2. Consider the following program. Fill in the blanks as per the instructions given below:

• at LINE-1 and LINE-3 with appropriate inheritance statement,• at LINE-2 and LINE-4 with appropriate initialization lists,

class Car : public Vehicle{    //LINE-1

    protected: 
        int no_of_passengers;

    public:

        Car(int nw, int np) : Vehicle(nw),no_of_passengers(np) {} //LINE-2

        friend ostream& operator<<(ostream& os, const Car& d); 

};

class Truck : public Vehicle{    //LINE-3

    protected: 

        int load_capacity;

    public:

        Truck(int nw, int lc) : Vehicle(nw),load_capacity(lc) {} //LINE

???? Next Week Answers: Assignment 06 ????

quizxp telegram

Q3. Consider the following program. Fill in the blanks as per the instructions given below:

• at LINE-1, LINE-2 and LINE-3 with initialization list,• at LINE-4, LINE-5 and LINE-6 with function definitions,

A::A(int _a) : a{_a}{}    //LINE-1

B::B(int _a, int _b) : A{_a} {b=_b;}    //LINE-2

C::C(int _a, int _b, int _c) : B{_a,_b} {c=_c;}    //LINE-3

int A::sum(){ return a; }    //LINE-4 

int B::sum(){ return (A::sum()+b); }    //LINE-5

int C::sum(){ return (B::sum()+c); }    //LINE-6

For other courses answers:- Visit

For Internship and job updates:- Visit