CS304 VU Current Midterm Fall 2012 Paper 9 December 2012

1) Write any two advantages of const member function (2 marks).
2) Overloaded member function using ostream and istream show any example. (2 marks). 
3) How does const use to change the data? show any example (3 marks)
4) Overloded ka question tha aik (3 marks)
5) Write code for initializing call function from the following (5 marks)
6) code likhna tha constructor declare karna tha parent class ka n child class ka ( marks 5).
20 MCQ’s the jo k kuch past papers se the Moaz ki file se the n kuch conceptual b the, const k bht sare aae the!!
Const , overloaded, member function inhen thek se dekhen mere pas ink bht sarey questions aae the!!

Another Question:

Timing : 9am 08-12-2012
MCQ are mostly from past papers. 20 marks

  1. List of two operators that can’t be overloaded? (2 marks)
  2. Consider the following cal of an overloaded “+” operator. (2 marks)

Rational_number1+ Rational_number2;
Identify which object will be passed as an argument to the overloaded function. Justify your answer with at least 1 solid reason?

  1. Consider the following scenario: (3 marks)

A class X does not have any overloaded operator and has a member function “Subtract” to subtract two objects of X, and then placing the result in third object.
Where third is a calling object.

  1. Consider the following diagram. (5 marks)
Study program


List courses



What type of relationship exist
Implemented data members and member function in C++ with appropriate data types.
Implement the relationship between classes in C++.

  1. Ik function ta string ka (3 marks)
  1. Ik istara ka question ta k Relationships define karna ta in which women is a derived class and lady doctor is a base class. List banana the. (5 marks)

Another Paper:

20 objectives n 6 subjective…….

1.this pointer are not accessible for ___________.

2.A generalization-specialization relation between classes are implemented using
 ►data hiding
 ►friend classes
 ►encapsulation
 ►inheritance

3.A class can be identified from a statement by __________.

4.the member of the class that can be accessed and work as interface _______.

5.A class can be identified from a statement by ————-
 ►Noun (Page 58)
 ►Pronoun
 ►Verb
 ►Adverb

6.Which one is not keyword in C++?

► operator
► B_op ► const ► None of given


when static member of the class are initialized?justify your answer.(2)

write two different ways to overload the post increment operator?(2)

how can we overload stream extraction and insertion operator?(3)

1 class was given don’t remember ,question was where the +,-,* are overloaded and these are from left to right.(3)

what are accessor function ? explain with example(5)

write c++ code to overload subscript[] operator for string class.(5)