vu cs201 Mid Term Subjective Solved Past Paper No.6

vu cs201 Introduction to Programming Solved Past Papers

Solved Past Papers

This subjective solved past paper is related to book/course code vu cs201 Introduction to Programming which belongs to vu organization. We have 12 past papers available related to the book/course Introduction to Programming. This past paper has a total of 10 subjective questions belongs to topic Mid Term to get prepared. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to get prepared for exams by learning subjective questions online on NVAEducatio.

NVAEducation also facilitates users to download these solved past papers with an affordable prices. However, users are not enforced to pay for money, rather they can use credits to buy such stuff on NVAEducation. Users can earn credits for doing some little tasks and then you will be able to use that credits to buy solved past papers on NVAEducation.

Question 2: Explain the scope of private member of a class with one example.
Answer:

The scope of private data member of a class is that, only an access is allowed within the class. Only member function of class can access and modify the value of data member value. Derived class or class instance/object can?t directly access. Data Member will created for each separate object in the memory and will eliminated when object will be destroy. Object could be destroy by calling its destructor. Example:

Class arthimetic {
Private:
int a,b;
Public:
Add() {
A+b; // direct access by member function Correct Access
}
};
Int main() {
Arthimetic c1;
C1.a=4; // is illegal access to class private data member error will generate by compiler
}
Question 3: Explain two benefits of setter functions.
Answer:

Setters and getters functions are provided by class to access the its members it also minimizes the changes to move the objects in inconsistent state as we can write checks in our setter functions for example we can check that whether the user has entered correct age value and has not entered negative value for age.

  1. They help to define the variable in an interface
  2. To make a variable read-only
  3. Notify other methods / classes when the value is changed
(Page 67)
Question 4: Explain what type of copy the default assignment operator "'=" does when applied to objects. (shallow copy or deep copy)
Answer:
if our class has any data member using dynamic memory then we had to write our own code for default constructor, copy constructor and similarly assignment operator as compiler generated version of these functions performs shallow copy that creates dangling pointer, and memory leakage issues in case of dynamic memory allocation. (Page 147)
Question 5: Friend functions increase "Data vulnerability", what is your opinion?
Answer:
Friend functions minimize encapsulation as we can access private data of any class using friend functions, This can result in:
  1. Data vulnerability
  2. Programming bugs
  3. Tough debugging
Question 6: Friend functions increase "Programming bugs". What is your opinion?
Answer:
Yes friend functions can increase programming bugs some time.
Question 8: What is the Neural Network ?
Answer:

Neural Network

Hardware or software that attempt to emulate the processing patterns of the biological brain. It is a device, modeled after the human brain, in which several interconnected elements process information simultaneously, adapting and learning from past patterns.

Question 10: What is EIF.
Answer:
An external interface file (EIF) is a user identifiable group of logically related data or control information referenced by the application, but maintained within the boundary of another application. (Page 42)

Solved Past Papers of cs201 Introduction to Programming

Other cs related subjective solved past papers

Other categories of vu Solved Past Papers

Other organizations

Theme Customizer

Gaussian Texture



Gradient Background