# NPTEL An Introduction To Programming Through C++ Assignment 7 Answers 2022

**NPTEL An Introduction To Programming Through C++ Assignment 7 Answers 2022 :- **Here All The Questions and Answers Provided to Help All The Students and NPTEL Candidate as a Reference Purpose, It is Mandetory to Submit Your Weekly Assignment By Your Own Understand Level.

Are you looking for the Assignment Answers to **NPTEL An Introduction To Programming Through C++ Assignment 7 Answers 2022? **If Yes You are in Our Great Place to Getting Your Solution, This Post Should be help you with the Assignment answer to the **Nation**** al Programme on Technology Enhanced Learning (NPTEL)** Course “

**NPTEL An Introduction To Programming Through C++ Week 7**

**Solution 2022**”

Table of Contents

## An Introduction To Programming Through C++

*From My Side : This course provides an start to problem solving and programming using the C++ programming language. The topics tallying together occurring:
Basic programming notions. Control flow, variables and assignments statements, conditional be swift, looping, action calls including recursion. Arrays and structures. Elementary aspects of classes. Heap memory.
Program design. How human beings solve problems manually. Strategies for translating calendar strategies to computer programs. Organizing large programs into units such as functions and classes. Introduction to assertions and invariants.
Programming applications. Arithmetic going a propos for polynomials, matrices. Root finding. Sorting and searching. Design of editors and simulators, including graphical editors. Elementary buoyancy. A rudimentary graphics system will be discussed.
Standard Library of C++. The string, vector and map classes.
C++ is an slant-oriented programming language which gives a sure structure to programs and allows code to be reused, lowering fee costs
*

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

**INTENDED AUDIENCE : BE/BTech in all disciplines BCA/MCA/M. Sc**

**INDUSTRY SUPPORT : All IT Industries**

**CRITERIA TO GET A CERTIFICATE**

This course can have Associate in Nursing unproctored programming communication conjointly excluding the Proctored communication, please check announcement section for date and time. The programming communication can have a weightage of twenty fifth towards the ultimate score.

- Assignment score = 25% of average of best 8 assignments out of the total 12 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

**YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF ASSIGNMENT SCORE >=10/25 AND**

**UNPROCTORED PROGRAMMING EXAM SCORE >=10/25 AND PROCTORED EXAM SCORE >= 20/50.**

**If any one of the 3 criteria is not met, you will not be eligible for the certificate even if the Final score >= 40/100.**

**CHECK HERE OTHERS NPTEL ASSIGNMENTS ANSWERS **

*BELOW YOU CAN GET YOUR NPTEL An Introduction To Programming Through C++ Assignment 7 Answers 2022***?** :

**?**:

## NPTEL An Introduction To Programming Through C++ Assignment 7 Answers 2022

Q1. Consider the line of code

int x[4] = {10, 20, 30, 40};

What is the value of x[3]?

Answer By SciShowEngineer: 40

Q2. Suppose students can obtain any (integer) mark from 0 to 100. I would like a histogram giving the number of students getting marks in the range 0-4, 5-9, 10-14, … 95-99, 100. What size array do I need to store the histogram?

Answer By SciShowEngineer: 21

Q3. Consider the following program fragment: int a[10]; for(int i=0; i<10; i++) cin >> a[i]; bool s=true; for(int i=0; i<9; i++) if(a[i] < a[i+1]) s = false; cout << s; Which of the following are true?

a) The program outputs true if elements of a are in increasing order, i.e. a[i] < a[i+1] for i=0..8

b) The program outputs true if elements of a are in decreasing order, i.e. a[i] > a[i+1] for i=0..8

c) The program outputs true if elements of a are in non-increasing order, i.e. a[i] >= a[i+1] for i=0..8

d) The program always outputs true if elements of a are in non-decreasing order, i.e. a[i] <= a[i+1] for i=0..8

Answer By SciShowEngineer: b)

Q4. Consider the following function which is supposed to return true if all the numbers in an array A are even and false otherwise: bool allEven(int a[], int n){ int i=0; for(i=0; i<n; i++) if(a[i] %2 != 0) break; if(i == blank) return true; else return false; } What should be in place of blank? Answer By SciShowEngineer without any quotes or spaces.

Answer By SciShowEngineer: n Suppose we wish to know if 3 numbers in a set S add up to a certain target value T. The program below is meant to determine this, by going over all triples of numbers in S. It should check all triples, but not check any triple more than once. int main(){ int n; cin >> n; int S[n]; for(int i=0; i<n; i++) cin >> S[i]; int T; cin >> T; bool addsToT = false; for(int i=0; i<blank1; i++) for(int j=0; j<blank2; j++) for(int k=0; k<blank3; k++) if(S[i] + S[j] + S[k] == T) addsToT = true; cout << addsToT << endl; } Give the simplest Answer By SciShowEngineers for the questions below. Do not use quotes or unnecessary spaces.

Q5. What should blank1 be?

Answer By SciShowEngineer: n

Q6. What should blank2 be?

Answer By SciShowEngineer: i

Q7. What should blank3 be?

Answer By SciShowEngineer: j

Q8. Suppose that we wanted the program to print whether T is obtained by taking the sum of 3 numbers chosen from S with replacement, i.e. the same number can be used several times. The code above will work, but the blanks will need to be filled possibly differently. What should blank2 be for this case?

Answer By SciShowEngineer: n Consider the following code fragment. int q[4]={25, 26, 27, 28}; cout << q[0] << endl; cout << &q[2] << endl; cout << q << endl; q[0] = 6; q = 1600; Assume q[0] is stored at address 1500. Also assume that each int is 4 bytes wide, so q[1] will be stored at 1504, q[2] at 1508 and so on. Note that normally when you print an address, it will get printed in hexadecimal; but just for the exercises below assume that addresses are also printed in decimal.

Q9. State what value is printed by the statement in line 2.

Answer By SciShowEngineer: 25

Q10. State what value is printed by the statement in line 3.

Answer By SciShowEngineer: 1508

Q11. State what value is printed by the statement in line 4.

Answer By SciShowEngineer: 1500

Q12. Which of the following statements are true?

a) Line 5 contains a valid C++ statement.

b) Line 6 contains a valid C++ statement.

Answer By SciShowEngineer: a)

## NPTEL An Introduction To Programming Through C++ Programming Assignment 7 Answers 2022

Yhaa You have done it but next? if YOU Want to your Others * NPTEL An Introduction To Programming Through C++ Assignments Answers* Then

**Follow US HERE**and Join Telegram.