Sunteți pe pagina 1din 13

B.E / B.Tech. DEGREE EXAMINATION, NOV / DEC -2007.

Third Semester

Computer Science & Engineering

CS1204 – Object Oriented Programming

Part – A (10 x 2 = 20 Marks)

1. What is object oriented paradigm?


2. What is the use of the scope resolution operator :: in C++?
3. What are operators of C++ that cannot be overloaded?
4. How does constructor differ from normal functions?
5. What is the default access mode for class members?
6. What is an I/O stream?
7. What is the type of class for which objects cannot be created?
8. What type of inheritance is supported in Java?
9. What is java virtual machine?
10. What is multithreading?
Part – B (5 x 16 = 80 Marks)

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.

16. (a) Explain how to create a toolbox for your application.


Or
(b) Explain SDI and MDI applications in detail.
17. (a) Write down the steps of MFC OLE drag and drop processing with a neat diagram.
Or
(b) (i) Explain the steps involved in the creation of active X control. (Marks -8)
(ii) Highlight the features of COM (Marks -8)
18. (a) Explain how database connectivity can be achieved using ODBC. Write necessary coding
and also write coding to query the database.
Or
(b) Write an MFC Automation client program.

Computer Technology

OBJECT ORIENTED PROGRAMMING AND C++

(Common to B.Sc. Information Technology)

PART A – (10 X 2 = 20 marks)

1. Define Object Oriented Programming.


2. What is typecasting ? What are explicit and implicit type conversions?
3. Compare objects and classes.
4. Can a overloaded function be default argumented?
5. What is the limitation of unary operator overloading? How it is solved?
6. Can a constructor be private? Is so what it means, how to use it as a private?
7. C++ require that when a desired class object is created a base class constructor if one exists
be invoked. Why it is so?
8. Why it does not make a sense for a virtual method to be static?
9. What is the role of isostream.h and iomanip.h header files?
10. Differentiate binary and ASCII file.

PART B ( 5 X 16 = 80 marks)

11. (i) Explain the feature of OOP. (8)


(ii) Write a C++ program to find the sum of the digits of a given number (8)

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.

( ) – set the value of the object


[ ] – get the value of individual element
New – to allocate memory location
Delete – to deallocate the memory location

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:

Virtual void read ( ) ;


Void print ( ) ;
};
Class Z {

Int b ;

Public :

Virtual void read ( );


Virtual void print ( );
(16)
};
15. (a1) Create a class classed item with necessary data member and member
functions. Write a custom manipulator to print $ before the rate of an item.

(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)

B.E/B.Tech. DEGREE EXAMINATION, NOVEMEBER/DECEMBER 2007.

Fourth Semester

Electrical and Electronics Engineering

CS 1261- OBJECT ORIENTED PROGRAMMING

(Common to Electronics and Instrumentation Engineering/Instrumentation and control


Engineering)

(Regulation 2004)
Time : Three hours Maximum : 100 marks
Answer ALL questions.

PART A- (10 x2 = 20 marks)

1. What is data encapsulation?


2. What are the benefits of OOP language?
3. what is meant by file access specifier?
4. What is dynamic initialisation of objects?
5. Name few operators which can’t be overloaded.
6. What is abstract class?
7. If a = 25 after shifting it two times on its left what would be the value? What is the extra
precaution one has to take care before evaluating this while coding in Java?
8. Define method with reference to Java. How to call it?
9. Give the life cycle of a thread.
10. What is Applet tag?

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)

B.E. /B/Tech. DEGREE EXAMINATION,

NOVEMBER/DECEMBER 2006

Third Semester

Computer Science and Engineering

CS1204 – OBJECT ORIENTED PROGRAMMING

(Common to Information Technology and B.E. (Part – Time) Second Semester


Regulation 2005)

(Regulation 2004)

Time: Three hours Maximum: 100 Marks


Answer ALLquestions
PART A – (10 ´ 2 = 20 marks)
1. Name the mechanism that binds together code and the data it maniputes.
2. What is the application of the scope resolution operator: in C++?
3. What are the two parts of a class specification?
4. What is an operator function? Describe the syntax of an operator function.
5. Why is it necessary to include the file iostream in all our programs?
6. Name the two ways in which a file can be opened.
7. What is default for methods in Java?
8. What is the need for Java virtual machine?
9. What is a package?
10. What is an exception?
PART B – (5 ´ 16 = 80 marks)
11. (a) Explain the following concepts of object oriented programming:
(i) Data abstraction
(ii) Inheritance
(iii) Polymorphism and
(iv) Objects
In detail with an example. (16)
(b) (i) List out any five merits of object oriented methodlogy.

(ii) Compare and contrast the following control structures with


example.
If ….else statement and switch statement and do ….. while and the while
statement.
12. (a) Write a program to overload = operator. Assign values of data members of one
object to another object of the same type.
Or
(b) Write a C++ program using inheritance to implement the following.
A newspaper agent pays two variant rates for the delivery of newspapers. A
delivery boy can earn RS. 2 on a morning delivery but only Rs. 1.50 on an evening
delivery. Boys are salaried either for a morning delivery or for an evening paper round
but not for both. Read(Input) the code for round (0 for morning and 1 for evening) and
the number of total paper rounds in one week done by a boy and compute his earning and
display it.
13. (a) Write a program to write and read data in a file using object I/O functions write
( ) and read ( ). Declare class with data members name [2]
m int bill no, int _amount
debited and int received _ amount and in balance. Add 10 records and display the list of
persons with balances. The user should have a facility to modify the existing records.
(16)
Or
(b) (i) Describe the various file modes and its syntax. (6)
(ii) Discuss the need for exception with try, catch and throw keywords. (10)
14. (a) Write short notes on the following:
Final class, abstract class, modifier final, inner classes.
Or
(b) (i) State the rules for creating an identifier in Java.
(ii) Discuss about the reference variable array and the primitive data types byte,
long, double. (10)
15. (a) Discuss how interface is implemented in Java with an example. (16)
Or
(b) What is a thread? State how synchronization is dealt while using multithreading.
(16)
****

B.E. /B/Tech. DEGREE EXAMINATION, MAY/JUNE 2007

Third Semester
Computer Science and Engineering

CS1204 – OBJECT ORIENTED PROGRAMMING


(Common to Information Technology and B.E. (Part – Time) Second Semester
Regulation 2005)
(Regulation 2004)

Time: Three hours Maximum: 100 Marks


Answer ALLquestions PART A – (10 ´ 2 = 20 marks)
1. What are the main characteristics of OOP language?
2. What are the valid types of data that the main( ) can return in C/C++ language?
3. What are the difference between default and parameterized constructors?
4. List out the properties of a static member function.
5. What are the functions supported by file stream classes for performing I/O
operations?
6. What are the types of exceptions? C++ provides what type of exceptions.
7. Define JVM.
8. What is the major difference between interfaces and classes?
9. ‘define multithreading.
10. What are the two methods by which we may stop threads?
PART B – (5 ´ 16 = 80 marks)
11. (a) (i) Describe the advantages of OOP. (8)
(ii) What are the differences between pointers to constants and constant
pointers? (8)
Or
(b) (i) Describe the applications of OOP technology. (8)
(ii) What is inline function? Explain the situations where jinline
expansion may no work? (8)

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.

B.E./B.TECH. DEGREE EXAMINATION MAY/JUNE 2006


fourth semester
Electrical and Electronics Engineering
EE 237-OBJECT ORIENTED PROGRAMMING
REGULATION 2001
time:Three hours maximum:100 marks
answer all questions.
PART A (10*2=20MARKS)
1.What are the features provided by object based and object oriented languages?

2.What type of abstraction is employed in (a) procedure (b) Object Oriented Programming?

3.Model a mobile phone as a class.

4.Write a function to swap two integer values using reference variables.

5.What are the operators of C++ that cannot be overloaded?

6.Indicate how different types of members of base class are visible in (a) Public and (b) Private
derivation.

7.Describe the following function's declaration

virtual void service (int n) = 0;

8.Can you have a class named main in C++? If yes, how do you call its constructor?

9.What is the main purpose of a template in C++? Give an example.

10.Which of the following statements are correct?

int const *pi = & x;

(a) x=10;
(b) *pi=10;
(c) pi ++;
(d) ++*pi;

PART B-(5*16=80 MARKS)

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.

(i) Data Encapsulation


(ii) Polymorphism
(iii) Genericity
(iv)Inheritance. (4*4=16 marks)
OR
(b) (i) Is there a difference between List x and List x ()? Explain. (6 marks)
(ii) How do member functions, friend functions and non member functions differ? Give a
programming example to support your answer. (10 marks)

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

14 (a) Assume the following is allowed


Complex c1 (5,4), c2 (-5,4);

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?

B x; cout << "Done" (6 marks)

(ii) Give the syntax of fuction template. Write a template function for sorting. Write a test program
to illustrate its use. (10 marks)

B.E / B.Tech. DEGREE EXAMINATION, NOV / DEC -2007.

Third Semester

Computer Science & Engineering

CS1204 – Object Oriented Programming


Part – A (10 x 2 = 20 Marks)

1. What is object oriented paradigm?


2. What is the use of the scope resolution operator :: in C++?
3. What are operators of C++ that cannot be overloaded?
4. How does constructor differ from normal functions?
5. What is the default access mode for class members?
6. What is an I/O stream?
7. What is the type of class for which objects cannot be created?
8. What type of inheritance is supported in Java?
9. What is java virtual machine?
10. What is multithreading?
Part – B (5 x 16 = 80 Marks)

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.

16. (a) Explain how to create a toolbox for your application.


Or
(b) Explain SDI and MDI applications in detail.
17. (a) Write down the steps of MFC OLE drag and drop processing with a neat diagram.
Or
(b) (i) Explain the steps involved in the creation of active X control. (Marks -8)
(ii) Highlight the features of COM (Marks -8)
18. (a) Explain how database connectivity can be achieved using ODBC. Write necessary coding
and also write coding to query the database.
Or
(b) Write an MFC Automation client program.

B.E. /B/Tech. DEGREE EXAMINATION,


NOVEMBER/DECEMBER 2006
Third Semester
Computer Science and Engineering
CS1204 – OBJECT ORIENTED PROGRAMMING
(Common to Information Technology and B.E. (Part – Time) Second Semester
Regulation 2005)
(Regulation 2004)
Time: Three hours Maximum: 100 Marks Answer ALL
questions
PART A – (10 ´ 2 = 20 marks)
1. Name the mechanism that binds together code and the data it manipulates.
2. What is the application of the scope resolution operator: in C++?
3. What are the two parts of a class specification?
4. What is an operator function? Describe the syntax of an operator function.
5. Why is it necessary to include the file iostream in all our programs?
6. Name the two ways in which a file can be opened.
7. What is default for methods in Java?
8. What is the need for Java virtual machine?
9. What is a package?
10. What is an exception?
PART B – (5 ´ 16 = 80 marks)
11. (a) Explain the following concepts of object oriented programming:
(i) Data abstraction
(ii) Inheritance
(iii) Polymorphism and
(iv) Objects
In detail with an example. (16)
(b) (i) List out any five merits of object oriented methodology.

(ii) Compare and contrast the following control structures with


example.
If ….else statement and switch statement and do ….. while and the while
statement.
12. (a) Write a program to overload = operator. Assign values of data members of one
object to another object of the same type.
Or
(b) Write a C++ program using inheritance to implement the following.
A newspaper agent pays two variant rates for the delivery of newspapers. A
delivery boy can earn RS. 2 on a morning delivery but only Rs. 1.50 on an evening
delivery. Boys are salaried either for a morning delivery or for an evening paper round
but not for both. Read(Input) the code for round (0 for morning and 1 for evening) and
the number of total paper rounds in one week done by a boy and compute his earning and
display it.
13. (a) Write a program to write and read data in a file using object I/O functions write
( ) and read ( ). Declare class with data members name [2]
m int bill no, int _amount
debited and int received _ amount and in balance. Add 10 records and display the list of
persons with balances. The user should have a facility to modify the existing records.
(16)
Or
(b) (i) Describe the various file modes and its syntax. (6)
(ii) Discuss the need for exception with try, catch and throw keywords. (10)
14. (a) Write short notes on the following:
Final class, abstract class, modifier final, inner classes.
Or
(b) (i) State the rules for creating an identifier in Java.
(ii) Discuss about the reference variable array and the primitive data types byte,
long, double. (10)
15. (a) Discuss how interface is implemented in Java with an example. (16)
Or
(b) What is a thread? State how synchronization is dealt while using multithreading.
(16)

B.E. /B/Tech. DEGREE EXAMINATION, MAY/JUNE 2007


Third Semester
Computer Science and Engineering
CS1204 – OBJECT ORIENTED PROGRAMMING
(Common to Information Technology and B.E. (Part – Time) Second Semester
Regulation 2005)
(Regulation 2004)
Time: Three hours Maximum: 100 Marks Answer ALL
questions
PART A – (10 ´ 2 = 20 marks)
1. What are the main characteristics of OOP language?
2. What are the valid types of data that the main( ) can return in C/C++ language?
3. What are the difference between default and parameterized constructors?
4. List out the properties of a static member function.
5. What are the functions supported by file stream classes for performing I/O
operations?
6. What are the types of exceptions? C++ provides what type of exceptions.
7. Define JVM.
8. What is the major difference between interfaces and classes?
9. ‘define multithreading.
10. What are the two methods by which we may stop threads?
PART B – (5 ´ 16 = 80 marks)
11. (a) (i) Describe the advantages of OOP. (8)
(ii) What are the differences between pointers to constants and constant
pointers? (8)
Or
(b) (i) Describe the applications of OOP technology. (8)
(ii) What is inline function? Explain the situations where jinline
expansion may no work? (8)

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.

S-ar putea să vă placă și