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

NPTEL An Introduction to Programming Through C++ Assignment 11

Are you looking for the Answers to NPTEL An Introduction to Programming Through C++ Assignment 11? 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 11

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 11

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 11 Answers:-

Q1. What’s printed by the following code fragment?

set<int> s;
s.insert(100);
s.insert(25);
for(auto e : s) cout << e;

Answer:- Answers will be notified on the telegram channel so JOIN

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

Q2. What is printed by the following code

Answer:

Q3. Suppose during a certain execution, 5 reallocations happened due to push backs on a certain vector. What is the minimum number of elements that the vector must have at the end of the execution?

Answer:

Q4. How many copying operations (overhead) must have happened during the execution?

Answer:

Q5. Suppose at a certain time during execution a vector has 100 elements (i.e. there have been 100 pushbacks). How many more push backs can there be without causing a reallocation?

Answer:

Q6. Answer T if you think the following statement is true and F if false:The total number of copying operations performed as a part of reallocation is less than twice the number of elements in the vector (i.e. the number of elements pushed back).

Answer:-

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

Q7. Answer T if you think the following statement is true and F if false:The amount of memory allocated to a vector that is not in use to store elements is less than the amount of memory that is being used to store elements, i.e. the memory in use is more than the memory not in use

Answer:

Q8. What number is printed first?

Answer:

Q9. What number is printed second?

Answer:

Q10. I have information about which cities are in which countries. Using this information I want to write a program that answer questions of the form: (a) Is a city X in country Y. (b) Which cities are in country Y. What data structure is most convenient for representing the required information?

Answer:

Programming Assignment

Q1. In processing documents, we often build something called an index, or an inverted index. This is simply a set of pairs (word, occurrences)where word is a word occurring in the document, and occurrences is a sequence of integers giving the positions (in increasing order) at which theword occurs. You are to write a program which takes a document as input and prints the index for it, with the words in ascending order (lexicographically).Note that all upper case letters have smaller ASCII values than lower case letters and so will appear earlier.

A word is a sequence of non-whitespace character(s). A document is a sequence of words separated by whitespace character(s) with the last word ending with a period (“.”). Here is an example document: ask not what your country can do for you ask what you can do for your country.For building the index, the last word is to be considered without the ending period. The index for the above document is expected to be:

Code:-

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

Q2. In the lectures we discussed a way to store a fare table: a fare table gives the fare between two cities, and is stored in the following data structure:

map<string, map<string,double>>faretable;
You are to write a program that manages a fare table. It should support thecommands having the following formats:

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 11 Answers 2022:-In This article, we have provided the answers of An Introduction To Programming Through C++ Assignment 11. You must submit your assignment to your own knowledge.