adplus-dvertising

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 National Programme on Technology Enhanced Learning (NPTEL) Course “NPTEL An Introduction To Programming Through C++ WeekSolution 2022

 

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.

Final score = Assignment score + Unproctored programming exam score + Proctored Exam 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

 

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

Write a function that takes a number b, and a number N, and returns true/false indicating whether N is a power of b, ie bk=N for some non negative integer k. The function returns true if N can be expressed as a power of b, and false otherwise.Use the following function signature:
bool isPower(int b,int N).
The following code will be there, but won’t appear in your editor :
main_program{
int b,N;
cin>>b>>N;
if(isPower(b,N))
cout<<“Yes”<<endl;
else
cout<<“No”<<endl;
}
This invisible code will test your function. This code will read the values b and N from the test case and print out “Yes” if your function returns true and “No” otherwise.

You don’t need to write/copy the main program. You just need to write the isPower function, without the main_program or any of the header files.
Note : Ensure that the name of the function is isPower and it takes the two parameters and returns true or false without printing anything.
Explanation of Sample Testcase 1
Input : b=2, N=1024
Output : 1024 can be expressed as 210. So the function returns true and Yes gets printed out by the invisible code.

CODE:

bool isPower(int b, int N) {
int p = b;
while(p < N)
p *= b;
if(p == N)
return 1;
else
return 0;
}

Write a void function that takes two value parameters : a and b, and two reference parameters :q and r. It performs the integer division of a by b, and stores the quotient in q and the remainder in r. All the values : a, b, q and r can be stored in the int data type.Use the following function signature :
void div(int a, int b, int &q, int &r).
The following code will be there, but won’t appear in your editor :
main_program{
int a,b,q,r;
cin>>a>>b;
div(a,b,q,r);
cout<<q<<” “<<r<<endl;
}
This invisible code will test your function. This code will read the values a and b from the test case, call your div function and will print out the modified values of q and r.
You don’t need to write/copy the main program. You just need to write the div function, without the main_program or any of the header files.
Note : Ensure that the name of the function is div, and it takes the four parameters and stores the quotient and remainder of the division a/b in q and r without printing anything.
Explanation of Sample Testcase 1
Input : a=30, b=7
Output : 30/7 gives 4 as the quotient and 2 as the remainder. After the function returns, q contains 4 and r contains 2

CODE:

void div(int a, int b, int &q, int &r) {
*(&q) = a/b;
*(&r) = a%b;
}

Related Posts

Leave a Reply

Your email address will not be published.