CS6456 Oop Rejinpaul ND15 PDF
CS6456 Oop Rejinpaul ND15 PDF
CS6456 Oop Rejinpaul ND15 PDF
Fourth Semester
(Regulations 2013)
Time : Three hours Maximum : 100 marks
Answer ALL questions.
PART A - (10 x 2 = 20 marks)
10. How do you compare two strings by ignoring the case? Give an example.
PDF compression, OCR, web optimization using a watermarked evaluation copy of CVISION PDFCompressor
PART B - (5 x 16 = 80 marks)
11. (a) (i) Write a C++ program to implement a Binary Search Procedure to
find whether the given element is present in the array or not using
Objects and Classes. (6)
(ii) Write short notes on casting primitive data types to Object type and
vice versa with an example for each. (6)
(iii) What is a namespace? How do you resolve the name conflicts using
namespaces? Explain with an example. (4)
Or
(b) (i) Write a C++ program to find maximum of two numbers using inline
functions. (4)
(ii) Write a C++ program to find the area of the square, rectangle, circle
using function overloading. (8)
(iii) Briefly describe on the objected oriented features supported by C++.
(4)
Or
(b) (i) Develop an abstract Class Polygon from which Triangle and
Rectangle are derived. Each Polygon should contain the function
Area( ) to calculate the area of them. Invoke appropriate Area( )
function to calculate the area using pointer to base class and
pointers to derived classes. (12)
(ii) Create a 'Vector' named Student to add the names of the students
in a class. Also display the contents of the vector after adding
necessary elements. (4)
Or
2 27170
PDF compression, OCR, web optimization using a watermarked evaluation copy of CVISION PDFCompressor
(b) (i) Write a C++ program to accept integer or string values from the
user within a specified range. (Range has to be specified with
minimum and maximum by the user). If the input violates the
range, appropriate exception needs to be raised. (6)
(iii) Write short notes on the storage structures available with Standard
Template Libraries. (4)
14. (a) (i) What are Packages? How are they created and used? Illustrate it
with an example. (8)
(iii) Why java has been called as "Write Once and Run Anywhere"?
Explain. (4)
Or
(b) Write a Java application to implement Mark Processing system for a
University consisting of various disciplines such as Engineering, Science
and Arts. Grade calculation for the students differs across the disciplines.
(i) Grade calculation for Undergraduate Engineering students requires
the involvement of technical events apart from the marks obtained
in their subjects and Post graduate Engineering students require
research project as an additional component.
(ii) For Post graduate Science students, involvement of paper
presentation is required whereas assignment weightage is
mandatory for Post graduate Arts students.
Grades for Research scholars would be computed based on the
number of research articles published and number of research
projects done. Try to implement the above system polymorphically.
(16)
15. (a) (i) Create an application that executes two threads. First thread
displays the alphabets A to Z at every one second. The second
thread will display the alphabets Z to A at every two seconds. Both
the threads need to synchronize with each other for printing
alphabets. The Second thread has to wait until the first thread
finishes its execution. The application waits for all the threads to
finish the execution. (10)
Or
3 27170
PDF compression, OCR, web optimization using a watermarked evaluation copy of CVISION PDFCompressor
(b) (i) Write a Java program to accept a string from user and check
whether it is a file or directory. If it is a directory, count the number
of files in that directory. If it is a file, count the number of
consonants and display the contents of the file in a reverse order. (6)
Write a Java program that enters an 8-digit string for a birthdate.
The first two digits in the string are the month of birth, the next
two are the day and the remaining four are the year. The Java
program should squeeze out these substrings and calculate the
current age (Hint: Approximately print the difference in years).
Raise a NegativeAgeException if the calculated age is negative.
(10)
4 27170
PDF compression, OCR, web optimization using a watermarked evaluation copy of CVISION PDFCompressor