Skip to content
VUBuddy

CS201 Quiz 4 Solution by Abu Huraira Faraz

Introduction to Programming PDF 391 KBUpdated 23 Oct 2026
Quiz CS201 Quiz 4 Solution by Abu Huraira Faraz PDF 391 KB
vubuddy.com
Type
Quiz
Course
CS201 Introduction to Programming
Size
PDF 391 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 391 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 3. Download the file for all 3 pages.

CS201 QUIZ NO: 4 SOLUTION FILE

EFFORT BY: ABU HURAIRA FARAZ

  1. Templates provide way of abstracting ________ information. Answer: type
  2. Class is a user defined __________ Answer: data type
  3. New operator is used to allocate memory from the free store during. Answer: run time
  4. Which one of the following is not a possible state for a pointer? Answer: point to a type
  5. Local variable are stored in an area called ________ Answer: stack
  6. Types of templates in c++ language are _______ Answer: 2
  7. __________ Variables are those that are defined outside of main. Answer: Global
  8. The return type of operator function for << operator is __________ Answer: reference of ostream class

(ostream&)

  1. The return type of operator function for >> operator is __________ Answer: reference of istream class

(istream&)

  1. The first parameter of operator function for << operator ________ Answer: must be passed by reference
  2. What does the following statements mean? Int (*fp) (char*) Answer: pointer to function talking a char* argument and returns an int.
  3. When an object of a class is defined inside another class then, Answer: constructor of enclosing class will

be called first

  1. Ostream is an _________ operator Answer: standalone
  2. What is the role of constructor in classes? Answer: to initialize the data member of an object when it is created
  3. We cannot define friends for the ________ that are already written and not in our control. Answer: functions
  4. A template function must have Answer: one are more than one argument
  5. Ostream class is ________ are not under our control. Answer: built in
  6. :: is called _______ Answer: scope resolution operator
  7. How many destructors are allowed in a class? Answer: 1
  8. A variable which is defined inside a function is called Answer: none of the given option
  9. The first parameter of operator function for << operator _________ Answer: must be object of class
  10. _______ Variables are defined in the main. Answer: local
  11. Which value can we not assign to reference? Answer: null
  12. Court << i << “ “;Court << d << “ “; Court << f ;
  13. Above statement can be written within statement of one line as: Answer: cout << I << “ “cout << d << “

“Cout << f ;

  1. When a variable is defined as static in a class than____________ Answer: only one copy is created for all

objects of this class

  1. What is the use of function get operator? Answer: overloading the objects
  2. What will happen when the function call operator is overloaded? Answer: it will not modify the functions
  3. When an objects of a class is defined inside another class then, Answer: destructor of inner object will be

called first

  1. Endl is a parameter-less __________ manipulator that insert the new line besides flushing the buffer. Answer:

built – in

  1. The stream insertion and extraction operators are not already overloaded for _________Answer: built – in

data types

  1. Variable are those that are defined outside of main. Answer: global
  2. Ostream class is _______ and not under our control. Answer: built – in
  3. Automatic variable are created on __________ Answer: stack
  4. Templates provide way of abstracting _________ information. Answer: type
  5. Which of the following is an example of static memory allocation? Answer: array
  6. Variable are defined in a main. Answer: local
  7. Variable are used to maintain state. Answer: static
  8. Local variable are stored in an area called ________ Answer: stack
  9. :: is called Answer: scope resolution operator
  10. Variable has a single copy for the whole class. Answer: local
  11. Static variable which is defined in a function is initialized ________ Answer: only once during its life time
  12. The operator used for dereferencing or indirection is __________ Answer: *
  13. What does STL stand for? Answer: standard template library
  14. Local variable are stored in an area called _______ Answer: free memory
  15. The stream insertion and extraction operators are not already overloaded for ________ Answer: user –

defined data types

  1. What is stl constructor? Answer: a constructor to initialize an object with the values of another object.
  2. In the member initializer list the data members are initialized. Answer: in the order in which they are

defined within class

  1. Which one of the following is not a possible state for a pointer? Answer: hold the address of the specific

object

  1. Local variable are stored in an area called __________ Answer: stack
  2. The first parameter of operator function for << operator __________ Answer: must be passed by reference
  3. Static data members of a class can be _____________ Answer: public and private
  4. In statement Matrix m2 = m1; Answer: Assignment operator is being used
  5. The operator function for << (stream insertion) >> and stream extraction must be Answer: non-member

function of class

  1. Choose the right option. String* x, y; Answer: x is a pointer to a string, y is a string
  2. Which one of the following is not a possible state for a pointer? Answer: point to a type
  3. Class is a user defined ____________ Answer: data type
  4. What does the following statement mean? Answer: pointer to a pointer
  5. Automatic variable are created on __________ Answer: stat storage
  6. New operator allocates memory from free state and return ___________ Answer: a pointer/ a float

number/an integer number

  1. When an object of a class is defined inside another class then, Answer: none of the given option
  2. What is role of a constructor in classes? Answer: to initialize the data members of an object when it is created
  3. To get the memory address of a variable we use _______ Answer: &
  4. When a variable is defined as static in a class than____________ Answer: a copy of this variable is created for only static objects.
  5. Variable has a single copy for the whole class. Answer: static
  6. We cannot define friends for the ________ that are already written and not in our control. Answer: classes
  7. When an object of a class is defined inside another class then, Answer: none of the given option
All CS201 files →
CS201 Introduction to Programming All CS201 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.