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.

B.

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 the user enters 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 users enter 5 numbers 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.

B.

Question No 5: (6)                                                                                                                 (6)

Give one programming example of function overriding.

By:Prof. Fazal Rehman Shamil
CEO @ T4Tutorials
Last Modified: February 3, 2020

Leave a Reply

Your email address will not be published. Required fields are marked *