Beruflich Dokumente
Kultur Dokumente
Third Semester
11. (a) (i) Explain object-oriented paradigm with all its essential elements.
(ii) State the merits and demerits of object oriented methodology.
Or
(b) Explain the following concepts of object oriented programming in detail with an
example.
(i) Data abstraction
(ii) Inheritance
(iii) Polymorphism
(iv) Objects.
12. (a) (i) Write a C++ program to extract the elements placed in the odd position of the
array.
(ii) State the rules to be followed while overloading an operator. Write a program to illustrate
overloading.
Or
(b) (i) Discuss about polymorphism and its advantages.
(ii) Write a C++ program that will give the conditions of environment required,
food habits and unique characteristics of pet animals fish and dog. Define a
base called pet that describe any common household pet; two derived classes called fish and dog
with items specific to that type of animals. Write pure virtual functions in the base class for
operations that are common to both types of animals. Write a program to test the usage of
classes.
13. (a) (i) Explain the 4 functions seekg, seekp, tellg, tellp used for setting pointers during file
operation and show how they are derived from fstream class.
(ii) Write a program to append to the contents of a file.
Or
(b) (i) Write a program to write the text in a file. Display the contents of file in
reverse order.
(ii) What are the keywords used in C++ for exception handling? Describe their
usage with suitable example.
14. (a) (i) Explain the interface concept in Java.
(ii) Write a Java Program to compute the area of rectangle and square using interface.
Or
(b) (i) Compare the features of C++ Versus Java.
(ii) Give an example that fits the following inheritance hierarchy.
Write a Java program to implement this example.
15. (a) Explain about exception handling in Java with suitable examples.
Or
(b) What is a thread? State how synchronization is dealt while using multithreading.
Computer Technology
PART B ( 5 X 16 = 80 marks)
12. (a1) What is a qualifier ? Explain various qualifiers used in C++ (8)
(a2) What are strings? Are they standard or derived data types? Write an
interactive program to check whether a given string is a palindrome or not?
What happen if the end of string is missing? (8)
(or)
(b) What are command line arguments? Explain with an example. (6)
13. (a1) Write a program to keep track of number of instances created, alive and
destroyed using members, constructor and destructors. (6)
(a2) What is nested class? How does it differ from local class? Create a date as
a nested class of student qualifier class and do the manipulation of reading
and printing the date of birth and date of joining, of a student. (10)
(b) Write a program called vector with one indirection pointer as its data member.
Overload the operators.
14. (a) Design three class student, exam and results, where result in inherited from
exam and exam is inherited from student. Write possible constructors to
initialize the values. Write a main function to test the constructor execution by
creating objects. (16)
Or
(b) Can a constructir be virtual ? What is the use of virtual constructor? How
dynamic binding is achieved in the following program ?
Class X {
Int x;
Public :
Void read ();
};
Public:
Int b ;
Public :
(a2) Explain the iostream class hierarchy along with its member.
Or
(b1) Explain about the file opening modes and error handling functions (8)
(b2) Write a program to create a file called emp.dat with employee number, name,
BP, deductions and allowances as record fields. Open a file read the record
Calculate the salary and write it back to the same file. (8)
Fourth Semester
(Regulation 2004)
Time : Three hours Maximum : 100 marks
Answer ALL questions.
PART B- (5 X 16 = 80 marks)
11. (a) (i) Code a program in Java to illustrate the use of Interface which calculates the simple
interest and compound interest. (10)
(ii) How to implement interface? Also explain how interface in Java help to realize the funct-
Ionality of multiple inheritance. (6)
Or
(b) (i) Discuss on Java Applet (10)
(ii) How to create your own exceptions? Illustrate it with a small program coded in Java
(6)
12. (a) (i) What is method overloading? Illustrate it with a program to find area of rectangle and
Square. ( 8)
(ii) Modify the above program such that the concept of passing objects as parameter to
methods (8)
Or
(b) (i) Write a program in Java Illustrating ladder if else statement to process the result of
Statement. (8)
if average mark = 65 First Class
? 75 Distinction
? = 50 Second Class
? = 40 Third Class
Otherwise failed.
(ii) Use switch statement to read month and print it out. Code it in Java. (8)
13. (a) (i) List the applications of Object Oriented Programming. (8) (ii) Discuss on basic concepts
of Object Oriented Programming. (8)
(iii) Give general structure of C++ program? (4)
Or
(b) (i) How the manipulators are used to make unformatted input/output operations one? (8)
(ii) Write short notes on inline functions and default arguments. (4+4)
14. (a) (i) What are the advantages of polymorphism? (3)
(ii) How is function overloading enhance programming art and style? Illustrate with an
example. (7)
(iii) Why is type conversion? How does it help programmers? (6)
Or
(b) (i) What are the various types of Inheritance? Discuss any one with Illustration. (10)
(ii) Discuss the rules of operator overloading. (6)
15. (a) (i) How can you design a class? How to access data members? How is the message
commu-
nication done to access data members of other classes? (8)
(ii) Explain with example how can you use a common friend function to exchange the private
Values of 2 classes (8)
Or
b) (i) How to invoke a constructor? Passing arguments could be done with parameterized
constructor. Illustrate it. How to overload constructor? (10)
(ii) Describe the importance of destructors. (6)
NOVEMBER/DECEMBER 2006
Third Semester
(Regulation 2004)
Third Semester
Computer Science and Engineering
12. (a) (i) Explain copy constructor with suitable C++ coding.
(ii) List out the rules for overloading operators. (8)
Or
(b) (i) Explain hybrid inheritance with suitable C++ coding.
(ii) Define polymorphism. Explain the different types of
polymorphism.
13. (a) Write a C++ program to read from 2 files simultaneously.
Or
(b) Explain multiple catch statement with the help of suitable C++ coding.
14. (a) Explain method overriding with suitable Java coding.
Or
(b) (i) Write a Java program for alphabetical ordering of strings.
(ii) Explain the different forms of inheritance supported in Java. (6)
15. (a) Explain various forms of interface implementation. (16)
Or
(b) Write a Java program to throw user defined exceptions.
2.What type of abstraction is employed in (a) procedure (b) Object Oriented Programming?
6.Indicate how different types of members of base class are visible in (a) Public and (b) Private
derivation.
8.Can you have a class named main in C++? If yes, how do you call its constructor?
(a) x=10;
(b) *pi=10;
(c) pi ++;
(d) ++*pi;
11. (i) Model a delta network (with resistors) as a class.Equip the class with required data and
function members. Write a program to test the class and to display te equivalent delta network.(8
marks)
(ii) Simulate a simple electrical system using C++ program. Describe identification of classes and
objects. Write a test program to illustrate the design. (8 marks)
12. (a) Explain the following characteristics of object oriented programming with examples.
13 (a) (i) What are the different ways of writing default constructors? Give examples. (8 marks)
(ii) What is a dangling pointer? Give an example. (8 marks)
OR
(b) (i) What are the default arguments? Give an example to illustrate programming syntax. (8
marks)
(ii) Write a C++ program to print the following triangle of numbers.Keep your program as short as
possible.Read n as input. (8 marks)
1
22
333
4444
c1++; ++c2;
c2=c1 + c2;
c1 +=c2;
c1= -c1;
cout<< c1;
Write a C++ program to perform these operations. (16 marks)
OR
(b) Give an application that fits the following inheritance hierarchy and write the program for the
same. Each class should have atleast two data members and two function members.
(16 marks)
15. (a) (i) Explain the need for a virtual destructor? (8 marks)
(ii) Describe dynamic binding and how is it implemented in C++? (8 marks)
OR
(b) (i) Consider the following program segment:
class A {
public :
A (void) {cout << "How";}
~A (void) {cout << "What";}
};
class B : A {
public :
B (void) {cout << "Why";}
~B (void) {cout << "Hello";}
};
What does the declaration B x print? If the main function has the following two statements, what
will be the output?
(ii) Give the syntax of fuction template. Write a template function for sorting. Write a test program
to illustrate its use. (10 marks)
Third Semester
11. (a) (i) Explain object-oriented paradigm with all its essential elements.
(ii) State the merits and demerits of object oriented methodology.
Or
(b) Explain the following concepts of object oriented programming in detail with an
example.
(i) Data abstraction
(ii) Inheritance
(iii) Polymorphism
(iv) Objects.
12. (a) (i) Write a C++ program to extract the elements placed in the odd position of the
array.
(ii) State the rules to be followed while overloading an operator. Write a program to illustrate
overloading.
Or
(b) (i) Discuss about polymorphism and its advantages.
(ii) Write a C++ program that will give the conditions of environment required,
food habits and unique characteristics of pet animals fish and dog. Define a
base called pet that describe any common household pet; two derived classes called fish and dog
with items specific to that type of animals. Write pure virtual functions in the base class for
operations that are common to both types of animals. Write a program to test the usage of
classes.
13. (a) (i) Explain the 4 functions seekg, seekp, tellg, tellp used for setting pointers during file
operation and show how they are derived from fstream class.
(ii) Write a program to append to the contents of a file.
Or
(b) (i) Write a program to write the text in a file. Display the contents of file in
reverse order.
(ii) What are the keywords used in C++ for exception handling? Describe their
usage with suitable example.
14. (a) (i) Explain the interface concept in Java.
(ii) Write a Java Program to compute the area of rectangle and square using interface.
Or
(b) (i) Compare the features of C++ Versus Java.
(ii) Give an example that fits the following inheritance hierarchy.
Write a Java program to implement this example.
15. (a) Explain about exception handling in Java with suitable examples.
Or
(b) What is a thread? State how synchronization is dealt while using multithreading.
12. (a) (i) Explain copy constructor with suitable C++ coding.
(ii) List out the rules for overloading operators. (8)
Or
(b) (i) Explain hybrid inheritance with suitable C++ coding.
(ii) Define polymorphism. Explain the different types of
polymorphism.
13. (a) Write a C++ program to read from 2 files simultaneously.
Or
(b) Explain multiple catch statement with the help of suitable C++ coding.
14. (a) Explain method overriding with suitable Java coding.
Or
(b) (i) Write a Java program for alphabetical ordering of strings.
(ii) Explain the different forms of inheritance supported in Java. (6)
15. (a) Explain various forms of interface implementation. (16)
Or
(b) Write a Java program to throw user defined exceptions.