Skip to content
VUBuddy

CS201 Final Term Past Paper Spring 2005

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

CS201 Introduction to Programming · Final Term Examination – Spring 2005 · Time Allowed: 150 Minutes

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

solve the problem.

d. All coding questions should be answered using the C ++ syntax. You are allowed to use the Dev-C++ compiler to write and test your code. If you do so please remember to copy and paste your code into the examination solution area. (Do NOT share your code; your

colleague could get higher marks than you!!)

get an `F` grade in this course.

Total Questions: 10

Q1. Marks : 02

A friend function

com

o

must be having a prototype with no arguments

o

o

must be invoked by an object of the class that declares it a friend must be invoked by the class that declares it a friend

o

can access the private data of the class that declares it a friend

o

cannot access the data members of a class

Q2. Marks : 02

Which one of the following operators is a unary operator?

o

OR ( || )

o

AND ( &&)

o

o

Complement operator ( ~ ) XOR ( ^ )

o

Insertion operator (>>)

Q3. Marks : 10

Write a program that uses a function multiple(int,int) that determines for a pair of integers whether the second integer is a multiple of the first. The function should take two integer arguments and return 1 (true) if the second is a multiple of the first and 0 (false) otherwise. Use this function in a program that inputs a series of pairs of integers.

Q4. Marks : 02

The new operator

o

is used to declare objects or variables

o

can not create and initialize an object

o

names an object or variable

o

o

can allocate an appropriate amount of memory for an object or variable returns an address to an object or variable

Q5. Marks : 08

Write a program that uses a function template called min to determine the smaller of two arguments. Test the program using integer, character and floating point number pairs in main ().

Q6. Marks : 20

Create a class named Account, its data members are

i. Account NO · ii. Account Title · iii. Balance

a) Create the object of this class using parameterized constructor in order to initialize all the three data members i.e. Account NO. Account Title. Balance

b) Write a member function of this class named deposit (), this function will calculate the current balance for the user's account. In deposit function user will be prompted to enter the amount to be deposited and displays the incremented balance.

c) Write an other member function of this class named addToFile(), In this function write the values of the data members Account NO, Account Title and Balance in the file named Account.txt.

Also write the getter and setter functions for the data members of this class

Q7. Marks : 02

If the statements int j,k; j = 123; k= 234; int* q, * r; cout<<*q<<' '<<*r; are executed, what will be displayed?

o

The values of j and k

o

The addresses of q and r

o

The addresses of j and k

o

132 , 234

o

garbage values

Q8. Marks : 15

Write a class Rectangle that performs the mathematical operations (Subtraction and Multiplication) on its height and width with the help of operator overloading.

Class Rectangle should have the following Private data members

  1. height

Q2. width

  1. Write a parameterized constructor to initialize the data members.
  2. Write member functions to Overload the following Operators and Display

Correct answer: Write member functions to Overload the following Operators and Display

the Results.

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.