CS201 Final Term Past Paper Spring 2005
- Type
- Final term past paper
- Course
- CS201 Introduction to Programming
- Size
- PDF 201 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 4. Download the file for all 4 pages.
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
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
- height
Q2. width
Correct answer: Write member functions to Overload the following Operators and Display
the Results.
Related CS201 files
All CS201 files →- CS201 Final Term Past Paper Fall 2005 Final term PDF 191 KB
- CS201 Final Term Past Paper Spring 2006 Session 1 Final term PDF 161 KB
- CS201 Final Term Past Paper Fall 2008 Final term PDF 299 KB
- CS201 Final Term Past Paper Fall 2010 Final term DOC 26 KB
- CS201 Highlighted Handouts Set 5 Highlighted PDF 7 MB
- CS201 Solved Grand Quiz Spring 2021 by Riz Mughal Quiz PDF 936 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.