• Tuesday, June 25, 2024

NPTEL Programming In Modern C++ Week2 Programming Assignment 2024

NPTEL-Programming-In-Modern-C-Week2-Programming-Assignment-Solution

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

Programming In Modern C++ Week2 Programming Assignment 2024

INTENDED AUDIENCE :   Any interested audience PREREQUISITES :   10th standard/high school INDUSTRY SUPPORT :   Programming in C++ is so fundamental that all companies dealing with systems as well as application development (including web, IoT, embedded systems) have a need for the same. These include – Microsoft, Samsung, Xerox, Yahoo, Oracle, Google, IBM, TCS, Infosys, Amazon, Flipkart, etc. This course would help industry developers to be up-to-date with the advances in C++ so that they can remain at the state-of-the-art.

Course Layout

Programming in modern c++ 2024, programming assignment q1 :.

Consider the program below. • Fill in the blank at LINE-1 with an appropriate statement. The program must satisfy the given test cases.

Programming Assignment Q2 :

Consider the following program. • Fill in the blank at LINE-1 with appropriate formal arguments list. • Fill in the blank at LINE-2 with the appropriate return statement. The program must satisfy the sample input and output.

Programming Assignment Q3 :

Consider the following program.

  • Fill in the blanks at LINE-1 with appropriate function header

The program must satisfy the sample input and output.

' src=

  • All Courses
  • Privacy Policy

' src=

Swayam Solver

Learn Programming & Prepare for NPTEL Exams... Swayam Solver is your one-stop destination for NPTEL exam preparation.

NPTEL Programming in Modern C++ Programming Assignment Jan-2024 week 9 to 12 Swayam

     Please scroll down for latest Programs  👇 

W9_Programming_Qs-1

Public Test CasesInputExpected OutputActual OutputStatus

W9_Programming_Qs-2

W9_programming_qs-3, w10_programming_qs-1.

Private Test cases used for EvaluationStatus
Test Case 1

W10_Programming_Qs-2

W10_programming_qs-3, w11_programming_qs-1, w11_programming_qs-2, w11_programming_qs-3, w12_programming_qs-1, w12_programming_qs-2, no comments:, post a comment.

Keep your comments reader friendly. Be civil and respectful. No self-promotion or spam. Stick to the topic. Questions welcome.

swayam-logo

Programming in Modern C++

--> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> -->

Note: This exam date is subjected to change based on seat availability. You can check final exam date on your hall ticket.

Page Visits

Course layout, books and references, instructor bio.

programming in modern c nptel assignment week 2

Prof. Partha Pratim Das

Course certificate.

  • Assignment score = 25% of average of best 6 assignments out of the total 8 assignments given in the course. 
  • ( All assignments in a particular week will be counted towards final scoring - quizzes and programming assignments). 
  • Unproctored programming exam score = 25% of the average scores obtained as part of Unproctored programming exam - out of 100
  • Proctored Exam score =50% of the proctored certification exam score out of 100

programming in modern c nptel assignment week 2

DOWNLOAD APP

programming in modern c nptel assignment week 2

SWAYAM SUPPORT

Please choose the SWAYAM National Coordinator for support. * :

Spread the word.

Share the link on social media.

Confirm Password *

Username or email *

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Sorry, you do not have permission to ask a question, You must login to ask a question.

SIKSHAPATH Logo

SIKSHAPATH Latest Articles

Programming in modern c++ assignment week 2 2022.

A blog banner of programming in modern c++ nptel course answer

Students, are you searching for hints of Programming in Modern C++ NPTEL assignment week 2. So, you are landed on the right article where you will get hints for answers by scrolling down.

Programming in Modern C++ NPTEL Assignment Week 2

Q1. Consider the following function prototypes of function add()

P1: int add(int n1=0, int n2);

P2: int add(int = 0, int = 0);

P3: double add(double = 0, double d = 0.0);

P4: double add(int = 0, double d = 0.0);

P5: double add(int n1 = 0, int n2, double n3 = 0);

Which of the following sets consists of all valid prototypes of function add()?

a. {P1, P3} b. {P2, P3, P4} c. {P1, P2, P3, P4} d. {P2, P3, P5}

Answer: b. {P2, P3, P4}

For instant notification of any updates, Join us on telegram .

Q2. Consider the following function prototypes of function add().

P1: int add(int n1);

P3: double add(int = 0, double d = 0.0);

P4: int add(int = 0, double d = 0.0);

P5: double add(int n1 = 0, int n2 = 0, double n3 = 0);

Which of the above pairs of the prototypes is ambiguous and illegal as per the rule of function overloading?

Answer : c. P3, P4

Q3. Consider the following code segment.

What will be the output/error?

d. Compilation Error: call of overloaded ‘add (int, int)’ is ambiguous

Answer: d. Compilation Error: call of overloaded ‘add (int, int)’ is ambiguous

Q4. Consider the following code segment.

What will be the output?

Answer: b. 30 60

Q5. Consider the following code segment.

Choose the correct option to fill in the blank at LINE-1 such that the output is 11 11 20 20.

a. int incr(int i)

b. int incr(int& i)

c. int& incr(const int& i)

d. int& incr(int& i)

Answer: d. int& incr(int& i)

Q6. Consider the following code segment.

a. 1110 11001

b. 1011 1011

c. 12100 12100

d. 11001 1110

Answer: a. 1110 11001

Q7. Consider the following code segment.

d.  44 44

Answer: d.  44 44

Q8. Consider the following code segment.

Identify the correct statement/s to fill in the blank at LINE-1 such that the output is X.

a. const char* cp

b. char* const cp

c. char const* cp

d. const char * const cp.

Answer: a. const char* cp & c. char const* cp

Q9. Consider the following statement in C.

Among the given options below, identify the equivalent statement/s (perform the same task) in C++.

a. int *ip = new int(5);

b. int *ip = new int[5];

c. int *ip = (int *)operator new (sizeof(int) * 5);

d. int *ip = (int *) operator new (sizeof(int)) [5];

Answer: b. int *ip = new int[5];

Course Status : Completed
Course Type : Core
Duration : 12 weeks
Category :
Credit Points : 3
Undergraduate/Postgraduate
Start Date : 24 Jan 2022
End Date : 15 Apr 2022
Enrollment Ends : 07 Feb 2022
Exam Date : 23 Apr 2022 IST
(in one click)

Disclaimer: These answers are provided only for the purpose to help students to take references. This website does not claim any surety of 100% correct answers. So, this website urges you to complete your assignment yourself.

Also Available:

Programming in Modern C++ NPTEL Assignment Week 1

Related Posts

NPTEL Cloud Computing Assignment 3 Answers 2023

NPTEL Cloud Computing Assignment 3 Answers 2023

NPTEL Problem Solving Through Programming In C Week 1 & 2 Assignment Answers 2023

NPTEL Problem Solving Through Programming In C Week 1 & ...

NPTEL Programming In Java Week 6 Assignment Answers 2023

NPTEL Programming In Java Week 6 Assignment Answers 2023

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Programming in Modern C++ | Week 7

Session: JAN-APR 2024

Course Name: Programming in Modern C++

Course Link: Click Here

For answers or latest updates join our telegram channel: Click here to join

These are Nptel Programming in Modern C++ Assignment 7 Answers

Q1. Consider the following code segment. Fill in the blank at LINE-1 such that the program will print 3000 : 50. a) const_cast > (this) b) static_cast > (this) c) dynamic_cast <student> (this) d) (student) (this)

Answer: a), d)

Q2. Consider the following code segment. Which line/s will give you error? a) LINE-1 b) LINE-2 c) LINE-3 d) LINE-4

Answer: c), d)

Q3. Consider the following code segment. Fill in the blank at LINE-1 such that the program will be compiled successfully. a) static_cast<Test2*> b) dynamic_cast<Test2*> c) reinterpret_cast<Test2*> d) const_cast<Test2*>

Answer: a), c)

Q4. Consider the following code segment. Which of the following type-casting is permissible? a) t2 = static_cast<Test2*>(t1); b) t2 = dynamic_cast<Test2*>(t1); c) t2 = reinterpret_cast<Test2*>(t1); d) t2 = const_cast<Test2*>(t1);

Answer: c) t2 = reinterpret_cast<Test2*>(t1);

Q5. Consider the following code segment. What will be the output? a) 0101 b) 0111 c) 0110 d) 0011

Answer: d) 0011

Q6. Consider the following code segment. What will be the output? a) ABAB b) BABA c) BBAA d) BABB

Answer: c) BBAA

Q7. Consider the following code segment. What will be the VFT for the class C? a) A::F(A* const) C::G(C* const) C::H(C* const) B::I(B* const) b) A::F(A* const) B::G(B* const) C::H(C* const) B::I(B* const) c) A::F(A* const) B::G(B* const) B::H(B* const) C:: I(C* const) d) A::F(A* const) B::G(C* const) C::H(C* const) C::I(C* const)

Q8. Consider the following code segment. Fill in the blank at LINE-1 so that the program will print “200”. a) const_cast<int*> b) static_cast<int*> c) dynamic_cast<int*> d) (int*)

Q9. Consider the following code segment. How many virtual function table (VFT) will be created? a) 1 b) 2 c) 3 d) 4

Answer: c) 3

Programming

Complete the program with the following instructions. • Fill in the blank at LINE-1 to complete operator overloading for assignment operator. • Fill in the blanks at LINE-2 and LINE-3 to complete the type casting statements. The program must satisfy the given test cases.

Consider the following program with the following instructions. • Fill in the blank at LINE-1 to complete constructor definition. • Fill in the blank at LINE-2 to complete assignment operator overload function signature. • Fill in the blank at LINE-3 to complete integer cast operator overload function signature. The program must satisfy the sample input and output.

Consider the following program. Fill in the blanks as per the instructions given below : • at LINE-1, LINE-2, LINE-3 and LINE-4 with appropriate inheritance statements such that it will satisfy the given test cases.

More Weeks of Programming in Modern C++: Click here

More Nptel Courses: Click here

Session: JULY-DEC 2023

Question 1 Consider the following program. Fill in the blanks as per the instructions given below: • at LINE-1, complete the constructor statement, • at LINE-2 and LINE-3, complete the operator overloading function header, such that it will satisfy the given test cases.

Question 2 Consider the following program. Fill in the blanks as per the instructions given below. • at LINE-1, complete the constructor definition, • at LINE-2, complete the overload function header, such that it will satisfy the given test cases.

Question 3 Consider the following program. Fill in the blanks as per the instructions given below: • at LINE-1, complete the overload function header, • at LINE-2, complete the casting operator statement, • at LINE-3, complete the casting operator statement, such that it will satisfy the given test cases.

Q1. Consider the following code segment. Fill in the blank at LINE-1 and LINE-2 with the same statement such that the program will print Rajan : 5000. a) const_cast (this) b) static_cast (this) c) dynamic_cast (this) d) (employee*) (this)

Answer: a, d

Q2. Consider the following code segment. What will be virtual function table (VFT) for the class C? a) C::f(C* const) B::g(B* const) C::h(C* const) B::i(B* const) b) A::f(A* const) B::g(B* const) C::h(C* const) B::i(B* const) c) A::f(A* const) B::g(B* const) B::h(B* const) C::i(C* const) d) A::f(A* const) B::g(B* const) C::h(C* const) C::i(C* const)

Answer: a) C::f(C* const) B::g(B* const) C::h(C* const) B::i(B* const)

Q3. Consider the following code segment. Which line/s will give compilation error? a) LINE-1 b) LINE-2 c) LINE-3 d) LINE-4

Answer: c, d

Q4. Consider the following code segment. Which of the following type-casting is permissible? a) t2 = static_cast< Test2* >(t1); b) t2 = dynamic_cast< Test2* >(t1); c) t2 = reinterpret_cast< Test2* >(t1); d) t2 = const_cast< Test2* >(t1);

Answer: c) t2 = reinterpret_cast< Test2* >(t1);

Q5. Consider the following code segment. What will be the output? a) 0101 b) 0111 c) 0110 d) 0010

Answer: b) 0111

Q6. Consider the following code segment. What will be the output? a) 0101 b) 0111 c) 0110 d) 0010

Answer: c) 0110

Q7. Consider the following code segment. Fill in the blank at LINE-1 so that the program will print 9.81. a) const_cast< double* > b) static_cast< double* > c) dynamic_cast< double* > d) (const doubles)

Answer: a) const_cast< double* >

Q8. Consider the following code segment. Fill in the blank at LINE-1 so that the program will print “C++”. a) reinterpret._cast< C2* > b) static_cast< C2* > c) dynamic_cast< C2* > d) (C2%)

Q9. Consider the following code segment below. How many virtual function table (VFT) will be created? a) 1 b) 2 c) 3 d) 4

Programming Assignment of Programming in Modern C++

Consider the following program. Fill in the blanks as per the instructions given below: • at LINE-1 to complete the constructor definition, • at LINE-2 to complete the function header to overload operator for type-casting to char, • at LINE-3 to complete the function header to overload operator for type-casting to int, such that it will satisfy the given test cases.

More Solutions of Programming in Modern C++: Click Here

More NPTEL Solutions: https://progiez.com/nptel-assignment-answers/

These are Nptel Programming in Modern C++ Assignment 7 Answers

The content uploaded on this website is for reference purposes only. Please do it yourself first.

COMMENTS

  1. NPTEL Programming In Modern C++ Week 2 Programming Assignment

    NPTEL Programming In Modern C++ Week 2 Programming Assignment. August 6, 2022. Faheem Ahmad. 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 ...

  2. NPTEL Programming in Modern C++ WEEK 2 ASSIGNMENT 2 ANSWERS Solutions

    Nptel Programming in Modern C++ | Week 2 : Assignment 2 | Jan-2024Week 2 Assignment Answers with proof | 100% correct answersNPTEL - Programming in Modern...

  3. Nptel Programming In Modern C++ Assignment 2 Answers

    These are Nptel Programming in Modern C++ Assignment 2 Answers. Question 2. Consider the following program. • Fill in the blank at LINE-1 with appropriate formal arguments list. • Fill in the blank at LINE-2 with the appropriate return statement. The program must satisfy the sample input and output.

  4. Programming In Modern C++ Week 2 Quiz Assignment Solution

    Programming In Modern C++ Week 2 Quiz Assignment Solution | NPTEL | SWAYAM | 2024Your Queries : programming in modern c++nptel assignment solutionnptel assig...

  5. NPTEL Week 2 Assignment: Programming in Modern C++ July 2023

    NPTEL Week 2 Assignment: Programming in Modern C++ July 2023 is an informative tutorial that provides a comprehensive walkthrough of the second week's progra...

  6. NPTEL Programming In Modern C++ Week2 Programming Assignment 2024

    NPTEL Programming In Modern C++ Week2 Programming Assignment 2024. February 5, 2024. Faheem Ahmad. 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 ...

  7. PDF Week 2 Programming Assignment

    Week 4 Quiz Week 4 Programming Assignment Week 5: Exception handling, input/output, file handling, string processing Week 5 Programming Assignment Week 6: Backtracking, scope, data structures; stacks, queues and heaps Week 6 Quiz Week 7: Classes, objects and user defined datatypes Week 7 Quiz Week 8: Dynamic programming, wrap-up Week 8 Programming

  8. Programming In Modern C++

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

  9. Nptel Programming In Modern C++ Assignment 1 Answers

    These are Nptel Programming in Modern C++ Assignment 1 Answers. Question 2. Consider the following program. • Fill in the blank at LINE-1 with the appropriate if statement, • Fill in the blank at LINE-2 and LINE-3 with the appropriate return statements. The program must satisfy the sample input and output.

  10. Computer Science and Engineering

    NPTEL provides E-learning through online Web and Video courses various streams. ... How to build a C/C++ program?: Part 2: Build Pipeline; week-03. Lecture 11: Classes and Objects; Lecture 12: Access Specifiers ... How to build a C/C++ program?: Part 2: Build Pipeline: Download: 16: Lecture 11: Classes and Objects:

  11. NPTEL Programming In Modern C++ Week2 Programming Assignment Solution

    🔊NPTEL Programming In Modern C++ Week2 Programming Assignment Solution | Jan 2024 | IIT Kharagpur⛳ABOUT THE COURSE :There has been a continual debate on whi...

  12. NPTEL Programming in Modern C++ Programming Assignment Jan-2024 week 9

    NPTEL Programming in Modern C++ Programming Assignment Jan-2024 week 9 to 12 Swayam Posted on March 22, 2024 Please scroll down for latest Programs 👇 . W9_Programming_Qs-1. Due on 2024-03-28, 23:59 IST. Your last recorded submission was on 2024-03-18, 22:22 IST.

  13. PDF Week 7 Programming Assignment 2

    Week 7 Programming Assignment 2 In this exercise you will write a program that keeps track of who is in a certain classroom. At the start, the classroom is empty.Then for some time, students keep arriving and departing until the door finally closes.These events are given to the program as input consisting of lines of the following form a x ...

  14. Nptel Programming In Modern C++ Assignment 10 Answers

    Answer: b), c) For answers or latest updates join our telegram channel: Click here to join. These are Nptel Programming in Modern C++ Assignment 10 Answers. Q5. Consider the following code segment (in C++11). Choose the appropriate option to fill in the blank at LINE-1 such that the output is 125IN. a) 5.0FT, 10.0IN.

  15. Programming in Modern C++

    The course also covers important advances in C++11 and later released features. PRE-REQUISITE: Programming & Data Structure (mandatory), Programming in C (optional). Design and Analysis of Algorithms (optional). INDUSRTY SUPPORT: Programming in C++ is so fundamental that all companies dealing with systems as well as application development ...

  16. NPTEL Programming in Modern C++ WEEK 2 ASSIGNMENT 2 ANSWERS Solutions

    Nptel Programming in Modern C++ | Week 2 : Assignment 2 | July-2023Week 2 Assignment Answers with proof | 100% correct answersJoin our Telegram Channel : ht...

  17. Programming in Modern C++ Assignment Week 2 2022

    Students, are you searching for hints of Programming in Modern C++ NPTEL assignment week 2. So, you are landed on the right article where you will get hints for answers by scrolling down. Programming in Modern C++ NPTEL Assignment Week 2. Q1. Consider the following function prototypes of function add()

  18. PDF Week 12 Programming Assignment 2

    position (r,c) (i.e. row r and column c) and (r', c') are said to capture each other if r=r' or c=c' or |r-r'=|c-c'|. A puzzle asks, find a configuration of 8 queens on distinct squares such that no pair of queens capture each other. In this problem you will write the main part of the program to find all possible configurations of n queens on ...

  19. NPTEL Programming In Modern C++ Week 2 Programming Assignment Q1

    🔊NPTEL Programming In Modern C++ Week 2 Programming Assignment Q1 Solution | July 2022 | IIT KharagpurCode Link: https://techiestalk.in/nptel-programming-in...

  20. Nptel Programming In Modern C++ Assignment 12 Answers

    These are Nptel Programming in Modern C++ Assignment 12 Answers. Q3. Consider the program (in C++11) given below that squares each element of vector vec and sums all the squared elements. Fill in the blank at LINE-1 with appropriate option (s) such that the output becomes 149 16 30. a) summation (vec, res)

  21. programming In modern C++

    Here in this video, we solve the programming In modern C++ | NPTEL WEEK 2 ASSIGNMENT SOLUTION | #nptel #assignment #solution #Programming_in_Modern_C++ #npte...

  22. Nptel Programming In Modern C++ Assignment 7 Answers

    Programming Assignment of Programming in Modern C++. Question 1. Complete the program with the following instructions. • Fill in the blank at LINE-1 to complete operator overloading for assignment operator. • Fill in the blanks at LINE-2 and LINE-3 to complete the type casting statements. The program must satisfy the given test cases. Solution:

  23. PDF Week 10 Programming Assignment 2

    03/07/2020 An Introduction To Programming Through C++ - Course https://onlinecourses.nptel.ac.in/noc20_cs53/progassignment?name=224 2/4 Test Case 1