Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

 Past Papers of Object-Oriented Programming

Past Papers of Object-Oriented Programming

This is just a sample paper of Object-Oriented Programming. Nature of papers questions can depend on your university or instructor that how he is taking the course content. Now let’s see a sample paper of Object-Oriented Programming.

Sample Paper 1 of Object-Oriented Programming

Course Title: Object-Oriented ProgrammingCourse Code: Confidential
Discipline /Program :  BSCSTotal Marks:30 
Time allowed: 2 HourInstructor’s Name: Confidential

Note: 

Attempt All Questions. Marks are written adjacent to each question.

 Question No 1                                                                                                                        (6)

What is operator overloading? Why we use operator overloading? Differentiate between the followings;

  1. Function overloading and function overriding
  2. Constructor overloading and operator overloading

Question No 2                                                                                                                        (6)

What is polymorphism? Write a program using polymorphism in which user enters the number if the number is positive and the number is also even, then print the cube of the number and if the number is odd and negative then print the square of the number.

Question No 3                                                                                                                        (6)

Write a program using multi-level inheritance in which user enter a number, the program will show the table of the given number from 1 to 10.

Question No 4                                                                                                                        (6)

What is output for the following programs?

A.

1.	float x=5.999;
2.		float *y,*z;
3.		y=&x;
4.		z=y;
5.		cout<<x<<","<<*(&x)<<","<<*y<<","<<*z<<"\n";

B.

int track[]={10,20,30,40},*striker;

	striker=track;
	track[1]+=30;
	cout<<"Striker>"<<*striker<<endl;
	*striker-=10;
	striker++;
	cout<<"Next@"<<*striker<<endl;
	striker+=2;
	cout<<"Last@"<<*striker<<endl;
	cout<<"Reset To"<<track[0]<<endl;

Question No 5:                                                                                                                       (6)

 Give one programming example of constructor overloading and function overloading.

Sample Paper 2 of Object-Oriented Programming

Course Title: Object-Oriented ProgrammingCourse Code: Confidential
Discipline /Program :  MCSTotal Marks:30 
Time allowed: 2 HourInstructor’s Name: Confidential

Note: 

Attempt All Questions. Marks are written adjacent to each question.

 Question No 1                                                                                                                        (6)

What are single and multiple inheritances. Write a program to find the grades of a student using multiple inheritances according to the following rules;

Grade A if marks are > 80

Grade B if marks are >70 and < 80

Grade C if marks are > 50 and <70

Grade F if marks are < 40

Question No 2                                                                                                                        (6)

What is Multilevel inheritance? Write a program using multi-level inheritance in which user enter the number, calculate the cube of the number, if the cube of the number is greater than 150 then print the square of the resultant cube, otherwise show the message “sorry”.

Question No 3                                                                                                                        (6)

Write a program in which user enter 5 number using for loop and all these numbers will store in an array. After that program will add these five numbers and show the result. Your program must support the concept of operator overloading.

Question No 4                                                                                                                        (6)

What is output for the following programs?

A.

A.	int a=32,*ptr=&a;
B.	
C.		char ch='A',&cho=ch;
D.		cho+=a;
E.		*ptr+=ch;
F.		cout<<a<<","<<ch<<endl;
G.		return 0;

B.

A.	const int i=20;
B.		const int *const ptr=&i;
C.		(*ptr)++;
D.		int j=15;
E.		ptr=&j;

Question No 5: (6)                                                                                                                 (6)

Give one programming example of function overriding.

Fazal Rehman Shamil Click Here to Know More
Instructor, Researcher, Blogger, SEO Expert, Poet and Publisher of International Journal Of Software, Technology & Science ISSN : 2616 - 5325
Dear Professors and Resarchers!You are welome to Cite these tutorials in your research or slides etc. Please don't forget to mention the reference of website. Copy Paste of text is strcitly forbidden. Images can be reuse because images are protected with watermark.