Skip to content
VUBuddy

CS201 Final Term Past Papers 3 with References

Introduction to Programming PDF 364 KBUpdated 23 Oct 2026
Final term past paper CS201 Final Term Past Papers 3 with References PDF 364 KB
vubuddy.com
Type
Final term past paper
Course
CS201 Introduction to Programming
Size
PDF 364 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 364 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 10. Download the file for all 10 pages.

FINALTERM EXAMINATION · Spring 2009 · CS201- Introduction to Programming · Solved by vuZs Solution Team · Fast Flyer < fastflyer2010 > · Farhat Qudsia < farhat.shah > · Zubair Hussain < zubair256 >

Q1. There are mainly -------------------- types of software (1 marks)

  1. Two
  2. Three
  3. Four
  4. Five

Correct answer: Two

Software is categorized into two main categories System Software Application Software

Q2. When x = 7; then the expression x%= 2; will calculate the value of x as, (1 marks)

  1. 1
  2. 3
  3. 7
  4. 2

Correct answer: 1

A pointer variable can be,

  1. Decremented only
  2. Incremented only
  3. Multiplied only
  4. Both 1 and 2

Correct answer: Both 1 and 2

Q4. setprecision is a parameter less manipulator. (1 marks)

  1. True
  2. False

Correct answer: False

Q5. We can change a Unary operator to Binary operator through operator overloading. (1 marks)

  1. False
  2. True

Correct answer: False

Q6. delete operator is used to return memory to free store which is allocated by the new operator (1 marks)

  1. True
  2. False

Correct answer: True

The objects are created with the new operator on free store, they will not be destroyed and memory will not be de-allocated unless we call delete operator to destroy the objects and de-allocate memory.

Q7. When we do dynamic memory allocation in the constructor of a class, then it is necessary to provide a destructor. (1 marks)

  1. True
  2. False

Correct answer: True

whenever we have a class in which the constructor allocates dynamic memory, it is necessary to provide a destructor that frees the memory.

Q8. What is the functionality of the following statement? (1 marks)

String str[5] = {String(“Programming”), String(“CS201”)};

  1. Default constructor will call for all objects of array
  2. Parameterized constructor will call for all objects of array
  3. Parameterized constructor will call for first 2 objects and default constructor for remaining objects
  4. Default constructor will call for first 3 objects and Parameterized constructor for remaining objects vuzs

Correct answer: Parameterized constructor will call for first 2 objects and default constructor for remaining objects

Q9. What is the sequence of event(s) when allocating memory using new operator? (1 marks)

  1. Only block of memory is allocated for objects
  2. Only constructor is called for objects
  3. Memory is allocated first before calling constructor
  4. Constructor is called first before allocating memory

Correct answer: Memory is allocated first before calling constructor

If a single object is allocated, operator new is called to allocate memory, and then the constructor is called to initialize the object.

  • If an array of objects is allocated, operator new[] is called to allocate memory for the whole array, and then the constructor is called for each element of the array.
  • When a single object is deleted, the destructor for the object is called first, and then operator delete is called to free the memory occupied by the object.
  • When an array of objects is deleted, the destructor for each element of the array object is called first, and then operator delete[] is called to free the memory occupied by the array.

Q10. Deleting an array of objects without specifying [] brackets may lead to memory leak (1 marks)

  1. True
  2. False

Q11. Which of the following data type will be assumed if no data type is specified with constant? (1 marks)

  1. short
  2. float
  3. int
  4. double

Correct answer: int

Q12. There is an array of characters having name ‘course’ that has to be initialized by string ‘programming’ which of the following is the correct way to do this, (1 marks)

i. course[] = {‘p’, ’r’, ’o’, ’g’, ’r’, ’a’, ’m’, ’m’, ’i’, ’n’, ’g’}; ii.course[] = ‘programming’ ; iii. course[12] = “programming” ; iv. course = “programming” ; Choose the correct options.

  1. (i) and (ii) only
  2. (i) and (iv) only
  3. (i) and (iii) only
  4. (ii) and (iii) only

Correct answer: (i) and (iii) only

Q13. What will be the correct syntax of the following statement? (1 marks)

ptr is a constant pointer to integer.

  1. const int *ptr ;
  2. const *int ptr ;
  3. int const *ptr ;
  4. int *const ptr ;

Correct answer: int *const ptr ;

The keyword const for pointers can appear before the type, after the type, or in both places. The following are legal declarations: const int * ptr1; /* A pointer to a constant integer: the value pointed to cannot be changed */ int * const ptr2; /* A constant pointer to integer: the integer can be changed, but ptr2 cannot point to anything else */ const int * const ptr3; /* A constant pointer to a constant integer: neither the value pointed to nor the pointer itself can be changed */

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.