Cs304 Mid Spring 2006

4
Note: Solve these papers by yourself VU Cafeteria is not responsible for any solved content MIDTERM EXAMINATION SPRING 2006 CS304 – object oriented programming (Session - 1 ) Marks: Time: 120min StudentID/LoginID: ______________________________ Student Name: ______________________________ Center Name/Code: ______________________________ Exam Date: Please read the following instructions carefully before attempting any question: 1. This examination is clos ed book, closed notes, closed neighbors. 2. Answer all qu estions. a. There is no choice. b. You will have to answer all question s correctly in t his examination to get the maximum possible marks. 3. Do not ask a ny questions about the contents of this examination from anyone. a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding. b. If you believe that s ome essential piece of information is missing, make an appropriate assumption and use it to solve the problem. 4. Examination also con sists of multiple-cho ice questions. C hoose only one choice as your answer. a. If you believe that two (or more) of the c hoices are the correct on es for a particular question, choose the best one. b. On the other hand, if you believe th at all of the choices provided for a particular question are the wrong ones, select the one that appears to you as being the least wrong. **WARNING: Please note that Virtual University takes serious note of unfair means. Anyone found involved in cheating will get an `F` grade in this course. VU Cafeteria  V  U   C  a  f  e  t  e  r  i  a Page 1 / 4

Transcript of Cs304 Mid Spring 2006

Page 1: Cs304 Mid Spring 2006

8/8/2019 Cs304 Mid Spring 2006

http://slidepdf.com/reader/full/cs304-mid-spring-2006 1/4Note: Solve these papers by yourself VU Cafeteria is not responsible for any solved content

MIDTERM EXAMINATION

SPRING 2006

CS304 – object oriented programming (Session - 1 )

Marks:

Time: 120min

StudentID/LoginID: ______________________________ 

Student Name: ______________________________ 

Center Name/Code: ______________________________ 

Exam Date:

Please read the following instructions carefully before attempting any

question:

1. This examination is closed book, closed notes, closed neighbors.

2. Answer all questions.

a. There is no choice.

b. You will have to answer all questions correctly in this examination to

get the maximum possible marks.

3. Do not ask any questions about the contents of this examination from

anyone.

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

b. If you believe that some essential piece of information is missing, makean appropriate assumption and use it to solve the problem.

4. Examination also consists of multiple-choice questions. Choose only one

choice as your answer.

a. If you believe that two (or more) of the choices are the correct ones for

a particular question, choose the best one.

b. On the other hand, if you believe that all of the choices provided for a

particular question are the wrong ones, select the one that appears toyou as being the least wrong.

**WARNING: Please note that Virtual University takes serious note of unfair means. Anyone found involved in cheating will get an `F` grade in thiscourse.

Cafeteria

 V U  C a

 f e t e r i a

Page 1 / 4

Page 2: Cs304 Mid Spring 2006

8/8/2019 Cs304 Mid Spring 2006

http://slidepdf.com/reader/full/cs304-mid-spring-2006 2/4Note: Solve these papers by yourself VU Cafeteria is not responsible for any solved content

For Teacher's use onlyQuestion 1 2 3 4 5 6 7 8 9 10 Total

Marks

Question No: 1 ( Marks: 2 )

int *p=new int;

In the code given above, memory is allocated during program:

• compilation

• linking

• execution

• loading

Question No: 2 ( Marks: 2 )The proper syntax to free the memory allocated to array a of five objects is

• free(a,5);

• delete(a,5);• delete a;

• delete [] a;

Question No: 3 ( Marks: 6 )What methods would you add to make this class declaration very useful?

Class Cat{

int GetAge() const;

private:int itsAge;};

Question No: 4 ( Marks: 18 )Write a class Coordinate that performs the mathematical operations (Addition andMultiplication) on its coordinates with the help of operator overloading.

Class Coordinate should have the following Private data members1. xCord2. yCord

a) Write a parameterized constructor to initialize its coordinates/data members.b) Write member functions to Overload the following Operators and Display the Resultsafter Operations.

1. +2. *

Cafeteria

 V U  C a

 f e t e r i a

Page 2 / 4

Page 3: Cs304 Mid Spring 2006

8/8/2019 Cs304 Mid Spring 2006

http://slidepdf.com/reader/full/cs304-mid-spring-2006 3/4Note: Solve these papers by yourself VU Cafeteria is not responsible for any solved content

Question No: 5 ( Marks: 17 )Create a class named Employee, its data members are

i. empNameii. empDesignationiii. empSalary

a) Create the object of this class using parameterized constructor in order to initializeall the three data members i.e. empName, empDesignation and empSalary

b) Write a member function of this class named increment (), this function willcalculate the incremented salary of the employee. In increment function user willenter the increment amount in the current salary of the employee and displays theincremented salary after the addition of increment.

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

Question No: 6 ( Marks: 2 ) - Please choose one

A system call

► Is an entry point into the kernel code

►  Allows a program to request a kernel service

► Is a technique to protect I/O devices and other system resources

►  All of the these

Question No: 7 ( Marks: 2 ) - Please choose one

Logical address is generated by,

► CPU 

► Compiler 

► Hard disk 

► None of the these

Cafeteria

 V U  C a

 f e t e r i a

Page 3 / 4

Page 4: Cs304 Mid Spring 2006

8/8/2019 Cs304 Mid Spring 2006

http://slidepdf.com/reader/full/cs304-mid-spring-2006 4/4Note: Solve these papers by yourself VU Cafeteria is not responsible for any solved content

Cafeteria

 V U  C a

 f e t e r i a

Page 4 / 4