NPTEL An Introduction to Programming Through C++ Assignment 10 Answers 2022

NPTEL An Introduction to Programming Through C++ Assignment 10

Are you looking for the Answers to NPTEL An Introduction to Programming Through C++ Assignment 10? This article will help you with the answer to the National Programme on Technology Enhanced Learning (NPTEL) Course “ NPTEL An Introduction to Programming Through C++ Assignment 10

What is An Introduction to Programming Through C++?

This course provides an introduction to problem solving and programming using the C++ programming language. The topics include:

  • Basic programming notions. Control flow, variables and assignments statements, conditional execution, looping, function calls including recursion. Arrays and structures. Elementary aspects of classes. Heap memory. 
  • Program design. How human beings solve problems manually. Strategies for translating manual strategies to computer programs. Organizing large programs into units such as functions and classes. Introduction to assertions and invariants.
  • Programming applications. Arithmetic on polynomials, matrices. Root finding. Sorting and searching. Design of editors and simulators, including graphical editors. Elementary animation. A rudimentary graphics system will be discussed.
  • Standard Library of C++. The string, vector and map classes.

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 An Introduction to Programming Through C++ Assignment 10

Assignment No.Answers
An Intro to Programming C++ Assignment 1 Click Here
An Intro to Programming C++ Assignment 2 Click Here
An Intro to Programming C++ Assignment 3 Click Here
An Intro to Programming C++ Assignment 4 Click Here
An Intro to Programming C++ Assignment 5 Click Here
An Intro to Programming C++ Assignment 6 Click Here
An Intro to Programming C++ Assignment 7 Click Here
An Intro to Programming C++ Assignment 8 Click Here

NPTEL An Introduction to Programming Through C++ Assignment 10 Answers:-

Q1. To create an array of integers which can be accessed as A[0],…,A[4] residing on the heap the code to be executed is:

a. int A[5]; 
b. int *A = new int[5]; 
c. int A = new int[5];
d. int new A[5];

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

For Online programming test help and final exam preparation material Click Me

Q2. My program contains the line:

delete x;

It does not cause a compile time error. Which of the following is a possibledeclaration for x?

  • int x; 
  • double x; 
  • double *x; 
  • int x[10];

Answer: c

Q3. What is a memory leak? Pick the nearest description from those below.

  • The term refers to a pointer which does not point to a valid memory location. 
  • The term refers to a location in heap memory which has been allocated but to which your program has no pointer. 
  • The term refers to a memory location which is faulty. 
  • The term refers to a pointer which points to memory that has been deallocated.

Answer: b

Q4. What is a dangling pointer? Pick the nearest description from those below.

  • The term refers to a pointer which does not point to a valid memory location. 
  • The term refers to a location in heap memory which has been allocated but to which your program has no pointer. 
  • The term refers to a memory location which is faulty. 
  • The term refers to a pointer which points to memory that has been deallocated.

Answer: d

Q5. When we created the String class we redefined the = operator because

Answer: c

Q6. When I define the destructor for a class, under what circumstances should it delete the heap memory that a data member points to?

Answer:- b

For Online programming test help and final exam preparation material Click Me

Q7. What is the first number printed?

Answer: 10

Q8. What is the second number printed?

Answer: 9

Q9. What is the third number printed?

Answer: 8

Q10. Consider the following code fragment (assume appropriate header files have been loaded and using namespace commands issued)

Answer: xchgRate[“Yen”]=0.64

Q11. What should blank2 be?

Answer:xchgRate->first

Q12. What should blank3 be?

Answer: xchgRate->second

Q13. For which currency is the exchange rate printed first by the third statement?

Answer: a

Programming Assignment

Q1. Write a program which reads in and executes very simple programs in a very simple programming language which is as follows. The language has 4 statements, with the following formats.

Code:-

For Online programming test help and final exam preparation material Click Me

Q2. You are to write a function addM to add together two matrices, which are implemented as vectors of vectors. The matrices will only contain integers. If the matrices to be added are A,B and the sum is C, then we want C[i][j]=A[i][j]+B[i][j] for all i,j.

Code:-

For other courses answers:- Visit

For Internship and job updates:- Visit

Disclaimer:- We do not claim 100% surety of solutions, these solutions are based on our sole expertise, and by using posting these answers we are simply looking to help students as a reference, so we urge do your assignment on your own.

NPTEL An Introduction To Programming Through C++ Assignment 10 Answers 2022:-In This article, we have provided the answers of An Introduction To Programming Through C++ Assignment 10. You must submit your assignment to your own knowledge.