Monday, December 13, 2010

Refer these blogs for all subjects

http://jayashree-ds.blogspot.com/
http://jayashree-webprogramming.blogspot.com/
http://jayashree-sqlplsql.blogspot.com/
http://jayashree-dbms.blogspot.com/
http://cprogramming-jayashree.blogspot.com/
http://bca-3sem-vb.blogspot.com/
http://bca-3sem-se.blogspot.com/
http://bca-3sem-cpp.blogspot.com/

Wednesday, September 29, 2010

BOOK ON C++

Sams_Teach_Yourself_C.html
(OR)

Model Paper

Section A: Answer any 10 questions 2 x 10 = 20

1. What are the merits of OOP?
2. Compare cin and cout.
3. What are enumerated data types?
4. What is the use of scope resolution operator?
5. List different methods of calling functions.
6. What is the advantage of creating inline functions?
7. Give the syntax of overloading a unary operator with an example.
8. List the operators which cannot be overloaded.
9. Describe any three types of inheritance with examples.
10. Explain new and delete memory management operators.
11. Explain this pointer with an example.
12. Why do we need virtual function?
13. What is late binding?
14. What is a c++ stream?
15. What is the use of tellg() and seekg() functions?


Section B: Answer any 6 questions 6 x 5 = 30

1. Explain the usage of switch statement with example.
2. Explain the difference between structures and unions.
3. With an example, explain how do you create an array of objects?
4. Explain the meaning of different access specifiers.
5. Explain the usage of default arguments in functions with an example.
6. Give the advantages of inheritance.
7. Explain with an example, how you create space for an array of objects using pointers.
8. Explain the use of command line arguments with an example



Section C : Answer any 3 questions 3 x 10 = 30


1. a) What is function overloading?
b) Write a program to implement overloading of functions with default arguments, to find the factorial of a number.

2. a) What are constructors?
b) Write a program to copy a string using constructors.

3. a) What is operator overloading?
b) Write a program to add two complex numbers using the concept of operator overloading.
4. Describe different levels of inheritance with examples.
5. Create a student database using the concept of files. Include the following fields.
Name, Reg-No, Attendance
Enter data for 10 students and output the same in proper format.

Friday, September 24, 2010

Difference between Overloading and over riding

1. In overloading,there is a relation ship between methods
available in the same class where as in overridding,there
is relationship between a super class method and subclass
method.

2. overloading doesn't block inheritence from the
superclass where as overridding blocks inheritence.

3. in overloading,seperate methods share the same name
where as in overridding,subclass methods replaces the
superclass.

4.overloading must have different method signatures where
as overriding must have same signature

C++ Questions


Programming in C++

1) Output for code below will be

class sample

{

public:

sample( ) {

cout<<"constructed";

throw 1; }

~sample( ) { cout<<"destructed:"; }

};

int main( )

{

try

{

sample s;

}

catch(int x){ cout<<"caught:"; }

return 0;

}

a) compile time error

b) constructed destructed caught

c) constructed caught

d) caught

2) following statement/statement are true about namespace in c++

a) avoids name clashes.

b) can be extend over multiple header files.

c) Controls the name visibility.

d) None of above

3) following statement / statements are true about static

a) maintains the value for variable across the function calls

b) specifier for internal linkage

c) used to with classes to declare sharable data

d) all of above

4) following statement / statements are true about function template

a) it allows explicit specialization

b) it doesn’t allow for partial specialization

c) it never allows for default arguments

d) it allows full specialization

5) Consider a class having int* i, floa* j, float m, static int x as data members and

void f1( ), static void f2( ) as member functions. In a simple object model layout, size of the object will be

a) 24 bytes

b) 12 bytes

c) 4 bytes

d) 16 bytes

assume VC++ compiler and 32 bit computing.

6) following statement/statements are true about static methods of a class

a) can access only static members

b) called through class name & ::

c) can be used for overloading operators in a class

d) only a & b

7) class A has two int data members and one static int member. It has two virtual functions void f1( ) and void f2( ). Class B is derived from A having one double* member. The size of object of B class will be

a) 16 bytes

b) 28 bytes

c) 24 bytes

d) 20 bytes

8) following statement/statements are true about constructors in C++

a) initialize object

b) you can have literal virtual constrcutor

c) inherited to derived class (subclass)

d) you can write static constructors to initialize static members of class

9) following statement/statements are true about destructors in C++

a) destructors can be virtual

b) destructor can be called explicitly in case of automatic storage, like constructor

c) destructors can be overloaded like constructor

d) they are called by delete operator

10) following statement/statements are true about visitor design pattern

a) creating the objects

b) makes adding new operation easy

c) code reusability

d) accumulating state of objects

11) following statement/statements are true about template method design pattern

a) define the skeloton of an algorthim in an operation, deffering some steps to subclass.

b) technique for code reuse

c) controls the object accessibility

d) abstract out the object creation details

12) consider the following code, the o/p is

class A

{ public: A( ){ cout<<”A”;} };

class B: public A

{ public: B( ){ cout<<”B” ;} };

class C

{ public: C( ) {cout<< ”C”;}

private:

B bb;

};

int main( )

{

C cc;

}

a) ABC b) CBA c) BC d) CAB

13) Following provides RTTI

a) dynamic_cast b) typeid & type_info c) both d) reinterpret_cast

14) following statement/ statements are true about VTABLES in C++

a) generated by compiler at compile time

b) VTABLES are pointed by VPTR in object

c) Only one VPTR for each object in all scenarios of inheritance

d) generated by compiler at run-time

15) To share the object in memory by different client objects, following memory management technique is used

a) copy-to-write

b) reference counting

c) singleton

d) all of above

Thursday, August 26, 2010


Module 1: Introduction

2 Marks

1. What is C++? How is it different from C?
2. What are the enhanced features of C++ over C?
3. What are the application of C++?
4. List out all different data types in C++?
5. What is procedure oriented programming? How is it different from object oriented programming?
6. What is object oriented programming? How is it different from procedure oriented programming?
7. Mention the salient features of object oriented language?
8. What is an object? How are they created?
9. What is iostream.h, cin, cout?
10. Comparison of stdio.h and iostream.h.
11. Comparison of cin and cout.
12. What is a class?
13. What is Data hiding?
14. What is Data abstraction?
15. What is Data encapsulation?
16. What is Inheritance?
17. What is Reusability?
18. What is Polymorphism?
19. What is Dynamic binding? Explain.
20. What are types of Dynamic binding?
21. Mention the data type available in C++?
22. What is a keyword? List different keywords in C++.
23. Mention the different types of operators and expressions available in C++?
24. What is late binding? How is it different from static binding?
25. What is the difference between abstraction and encapsulation?
26. What is the difference between inheritance and polymorphism?
27. What is the difference between dynamic binding and message communication?

5 Marks

1. Difference between Object oriented programming and procedure oriented programming?
2. Merits and demerits of OOP?
3. Difference between POP and OOP?
4. Describe the characteristic of OOP?
5. What is function overloading? Explain.
6. What is operator overloading? Explain.
7. Explain the concepts of polymorphism.
8. Explain the concepts of Inheritance.





Module 2: Decision and loop

2 Marks

1. Mention the different looping statement in C++?
2. Difference between while and do-while statements?

5 Marks

1. What is nested if-else statement? Explain with example.
2. Explain Do-while loop statements with an example.
3. Explain different conditional statements with examples.
4. What is switch statement? Explain with an example.
5. What is break, continue and goto statement? Explain with example.
6. Explain for loop statement with example.

10 Marks

1. Explain different looping statements with examples.




Module 3: Arrays, String and Structure

2 Marks

1. What is an Array?
2. Mention the different type of Arrays.
3. What is a String?
4. Different methods to accept string.
5. What are structures?
6. What are enumerated data types?
7. When do you include iomanip.h in a program?

5 Marks

1. Explain different string manipulators.
2. How do you declare and define a structure. Explain with an example.
3. What are differences between structures and unions?
4. How are strings handled in C++. Explain.

Module 4: Objects & Classes

2 Marks

1. What is a class?
2. What are access specifiers?
3. What are objects? How do you create them?
4. What is the difference between object and class?
5. What is the use of scope resolution operator?
6. How are class members accessed?


5 Marks

1. Explain array of objects with a n example.
2. Explain array as class member data.
3. What is the difference between private, public and protected members.
4. Explain passing of objects as function arguments with an example.


Module 5: Functions in C++

2 Marks

1. What are the advantages of using a function?
2. What are built in functions? Give examples.
3. What is the role of return statement?


5 Marks

1. Explain different methods of calling a function.
2. What are inline functions? Explain with an example.
3. What is the difference between call by value and call by reference?
4. Explain the usage of default arguments in functions.
5. What is the difference between reference arguments and pointer arguments.

10 Marks

1. Explain storage classes – automatic, extern, Static and register with an example.
2. Explain overloading of functions with reference to
- different types of arguments
- different number of arguments
3. Explain different methods of calling functions with examples.


Module 6: Constructor & Destructor

2 Marks

1. What is a constructor?
2. What are dynamic constructors?

5 Marks
1. List the rules for using a constructor?
2. Explain different types of constructors with example.
3. What is a copy constructor? Explain with an example.
4. Explain constructor with arguments with example.
5. What is the difference between constructor and destructor?
6. What are the advantages of constructors and destructors?
7. Give the special properties of constructor functions.

10 Marks



Module 7: Operator Overloading

2 Marks

1. What is operator overloading?
2. List the operators which cannot be overloaded?
3. List the operators that can be overloaded?
4. What are the advantages of operators overloading?
5. Give the syntax of overloading a unary operator with an example?
6. Give the syntax of overloading a binary operator with an example?


5 Marks

1. What are the rules for overloading operator?
2. Give the difference between operator function and friend operator function.
3. What are the rules to be followed during data conversion while overloading operators?
4. Explain three types of conversions.
5. What are type conversions? Explain with an example conversion between basic types.
6. Explain with an example conversion between objects and basic types.
7. Explain with an example conversion between objects of different classes.

Module 8: Inheritance:

2 Marks
1. What is inheritance?
2. Give the advantages of inheritance.
3. List different types of inheritance.
4. Explain Multi-level inheritance with an example.
5. Explain multiple inheritance with an example.
6. Explain difference between Multi-level inheritance and multiple inheritance.

5 Marks

1. Describe the use of constructors and destructors in derived classes.
2. Describe any three types of inheritance with examples.


10 Marks

1. Create a base class for stack and implement push and pop operations. Include a derived class to check for stack criteria.



Module 9: Pointer

2 Marks
1. How a pointer variable is declared and accessed?
2. What are the applications of this pointer.


5 Marks
1. Explain memory management operations new and delete.
2. Explain this pointer with an example.
3. Explain with an example. How you create space for an array of objects using pointers.



Module 10: virtual functions

2 Marks:
1. What is a virtual function?
2. Why do we need virtual function?
3. What is late binding?
4. What are pure virtual functions?


5 Marks
1. Give basic rules for implementing late binding.
2. Explain virtual member function and abstract class


Module 11: Friend functions and static functions\

2 Marks:
1. What are friend functions?
2. What are friend class?
3. What are static Functions?
4. What is a template?
5. What are class template?
6. What is a function template?
7. What is member function template?
8. What is template argument list?

5 Marks
1. Give the advantages and disadvantages of template function?
2. Explain exception handling with an example.
3. Explain try and catch block with an example.
4. Distinguish between overloaded functions and function templates?
5. What is the difference between a Macro and a template

Module 12: console I/O operators

2 Marks
1. What is a c++ stream?
2. Describe the various stream classes.
3. List all unformatted I/O operators.
4. List all formatted I/O operators
5. Explain file Stream class.
6. What are the input and output streams?
7. What are the steps involved in using a file in a c++ program?
8. Describe the various classes available for file operation?
9. What are binary files?
10. What are character files?
11. What is the advantage of storing data in binary form?


5 Marks
1. Explain disk I/O with functions.
2. What is the rule of tellg() and seekg() functions?
3. Explain the use of command line arguments with an example.
4. What is a file mode? Describe the various file mode operations available.
5. Explain the various file stream class needed for file manipulation.
6. Explain read() and write() functions.