0% found this document useful (0 votes)
15 views2 pages

Object Oriented Programming

The document discusses a computer science examination on object oriented programming. It contains 6 questions related to OOP concepts like classes, inheritance, polymorphism, generics, exceptions, threads and design patterns.

Uploaded by

sara.gaikwad.45
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Object Oriented Programming

The document discusses a computer science examination on object oriented programming. It contains 6 questions related to OOP concepts like classes, inheritance, polymorphism, generics, exceptions, threads and design patterns.

Uploaded by

sara.gaikwad.45
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Course Code : CAT 104 / CCT 104 / QVRU/RS – 22 / 1249

CDT 104

Second Semester B. Tech. Computer Science and Engineering


( Artificial Intelligence and Machine Learning / Data Science /
Cyber Security ) Examination

OBJECT ORIENTED PROGRAMMING

Time : 3 Hours ] [ Max. Marks : 60

Instructions to Candidates :—
(1) Support your answers with proper code wherever required.
(2) Assume suitable data wherever required.

1. (a) What is the difference between the following literal values : 5, '5' and
"5" ? 2 (CO 1)
(b) Discuss the access modifiers in JAVA. 2 (CO 1)
(c) Create a class Month which will have data member as Month_Name and
Month_Number. Create proper constructors to demonstrate constructor overloading
and a Display method to display Month_Name and Month_Number. Design
a method "EQUAL" in the class month which will check if the Month_Name
and Month_Number is same in 2 month objects.
Create a class Demo with main ( ) to demonstrate all functionalities of month
class. 6 (CO 1)

2. (a) Create a class Person with private data members as person's name and
date of birth. Create an interface Sports with the method SetName and
AverageScore.
Create a class Graduate which is derived from Person and Sports. The
class Graduate has private data member as CGPA, Year of graduation.
Create a constructor and display method in the classes. Create a demo
class with main ( ) and demonstrate the use of all functions. 7 (CO 1)
(b) Explain the utility of final with respect to variable, class and method.
3 (CO 1)

QVRU/RS-22 / 1249 Contd.


3. (a) Consider a comma separated file "Employe.txt" with the information as
Employee_Number, Employee_Name, Designation, Salary.
Create a class employee to store the information of all employees.
Design a method Increment ( ) which will provide increment as follows :
(a) If the designation is Manager 30% increment will be given.
(b) If the designation is Salesman 20% increment will be given.
(c) If the designation is Clerk 10% increment will be given.
Write the Employee Details along with updated Salary in the new file
"SalaryIncremented.txt". 7 (CO 3)
(b) Discuss the 5 keywords used in exception handling in Java. 3 (CO 2)

4. (a) Create a class Student with data members as student name, roll number
and marks of 3 subjects. The data members should be initialized through
the constructor. Design a method to calculate percentage and store the result
in data member percentage. Store the information of 5 students in ArrayList.
Sort the ArrayList in descending order of percentage.
Write appropriate main( ) to demonstrate all the functionalities. 7 (CO 2)
(b) Discuss with an example generic with 2 type parameter. 3 (CO 2)

5. (a) Create a thread class which will add the elements of the 1D array from
start_index to end - index and stores the result in data member SUM.
Assume a 1D array stores 100 elements. Divide this array in 4 equal
parts. Create 4 threads to add each of the sub array. The final addition
of array will be displayed by main( ).
[HINT : Pass start and end index in the constructor.] 7 (CO 3)
(b) What is the use of synchronized keyword ? Briefly explain with an example.
3 (CO 3)

6. (a) How are Design Patterns classified ? Explain in brief with an example.
7 (CO 4)
(b) What are the advantages of using design pattern ? 3 (CO 4)

D
QVRU/RS-22 / 1249 2 105

You might also like