Vous êtes sur la page 1sur 3

FILES:

1. The file that stores the information in readable and printable form is called ________file Ans:(Text File)
2. The file that stores the information in non-readable form in the same format in which it is held in memory is called________
file Ans:(Binary File)
3. Which stream is uesed for read/write operation in file?
Ans: fstream ofstream ifstream bufferstream
4. By how many ways the files can be opened?
Ans:2ways 3 ways 1 way 4 ways
5. if fstream file; file.open(“book.dat”,ios::in);
The above way of opening the file is called_______ method. (Ans: Open () Method)
6. open a file named fun.txt in binary mode for read purpose in constructor method
Ans: ifstream fin(“fun.txt”,ios::read|ios::binary);
Or
Ans: fstream fin(“fun.txt”,ios::read|ios::binary);
7. What are the uses of ios::ate and ios::app modes?
Ans:
 ios::ate is used to position the file pointer at the end of the file and the user can be allowed to write both in forword
direction and backword direction to write
 ios::app is used to position the file pointer at the end of the file and the user can be allowed to write only in forword
direction and allowed for ackword tracing
Assume the fstream object as fin (for 8,9 and 10)
8. Write the code using getline function that reads maximum of 80 characters or untill we press ‘\n’
Ans:fin.getline (name, 80, ’\n’);
9. Write the syntax to read a block of data (assume the class object is “e”)
Ans:fin.read((char*)&e,sizeof(e));
10. Write the syntax to write a block of data (assume the class object is “s1”)
Ans:fout.write((char*)&s1,sizeof(s1));
11. List 4 random access file functions.
Ans:Seekg(),tellg(),seekp(),tellp();
12. What is the use of seekg() function explain with an example?
This is a input stream function helps to set the get_pointer (i.e)set the pointer to a particular location in read mode
13. What is the use of seekp() function explain with an example?
This is a output stream function helps to examine the get_pointer (i.e)examine the pointer in a particular location and
return it in write mode.
ARRAY
1. Define an Array.
2. Define a Pointer.
3. What is the relationship between an array and a pointer? (2)
4. Illustrate the use of self-referential structure with an help of example.
5. Sort the given key set: 42, 29,74,11,58 using Bubble Sort
6. Sort the given key set: 42,29,74,11,58 using selection sort
7. Sort the given key set: 42,29,74,11,58 using insertion sort
8. Row major address calculation formula
9. Column major address calculation formula
SQL
Define the following 19. Union operation
1. Data 20. DBA
2. Information 21. Database abstraction
3. Field 22. Data inconsistency
4. Record 1. Conceptual level of database implementation
5. File 2. Define domain.
6. Table 3. Cartesian product
7. Relation 4. Explain Characteristics of SQL
8. Database 5. List various data types used in SQL with their properties
9. Tuple 6. List and define various constraints used in SQL
10. Attribute 7. List and explain various DML commands in SQL
11. Degree 8. How will you eliminate the duplicate rows in table using SQL queries.
12. Cardinality 9. List and explain various aggregate functions used in SQL queries
13. Primary key 10. Explain the use of group by commands
14. Foreign key 11. When will you use the having class in SQL queries
15. Candidate key 12. Write the syntax of delete command with example
16. Alternate key 13. Write the syntax of update command with example
17. Selection operation 14. How will you create the view in SQL?
18. Projection operation 15. Write the features of view.
What are the uses of alter command in SQL ?.Explan

CLASS , CONSTRUCTOR,DESTRUCTOR,AND OTHERS WORKSHEET

1. Differences between fundamental and derived 19. Differentiate between abstract and concrete
data types class
2. What are the purposes of header files? 20. List of various programming paradigm and its
3. Define class and its syntax and its purpose and types
visibility modes 21. List the advantages and dis-advantages of
4. List constructors with its types procedural oriented programming
5. Define Destructor. Purpose and invoking 22. Explain oops and write the uses of oops
methods 23. Explain object based programming
6. Define polymorphism and list its types 24. Static binding
7. Explain function overloading with neat example 25. Order of executing of constructor
8. Explain constructor overloading with neat 26. Uses of access specifier
example 27. How to declare static member function and data
9. Define inheritance, data hiding, encapsulation member
10. Purpose of type def and # define explain with
examples
11. Advantages of library function
12. Differentiate between formal and actual
parameters
13. Concept of passing structure to a function
14. How to implement inheritance, data hiding,
encapsulation
15. Write short notes on recursive functions
16. Write short notes on modularity
17. Concept of object and inline fuction
18. Define base class and derived class with example
INHERITANCE:

What is inheritance? Discuss its various forms.

ANS : Inheritance is the capability of one class to inherit


properties from another class. Forms of Inheritance:

1. Single Inheritance: One base class and one super class.


2. Multiple Inheritance: Multiple base class and one sub class.
3. Hierarchical Inheritance: One base class and multiple sub class.
4. Multi-level Inheritance: A subclass inherits from a class that itself inherits from another class.
5. Hybrid Inheritance: A subclass inherits from multiple base classes and all of its base classes
inherit from a single
base class.

Discuss various reasons that support the concept of inheritance in Object Oriented Languages

The reasons that support the existence of inheritance concept in OO Languages are:

1. ‘Inheritance’ is capable of expressing the inheritance relationship of real-world models.


2. ‘Inheritance’ facilitates the code reusability.
‘Inheritance’ is capable of simulating the transitive nature of real-world’s inheritance.

Differentiate between public and protected visibility in context of Object Oriented Programming
giving suitable
examples for each.
Public visibility Protected visibility

The public derivation means that the derived class can The protected derivation means that the derived class

access the public and protected members of the base can access the public and private members of the base
class but not the private members of the base class. class protectedly.

With publicly derived class, the public members of the With protectedly derived class, the public and protected
base class become the public members of the derived members of the base class become protected members
of the derived class.
class, and the protected members of the base class
become the protected members of the derived class.

How does the visibility mode control the access of members in the derived class? Explain with
examples.

Visibility mode controls the access of member in derived class by using access specifier.
Below table shows different visibility modes.

Private inheritance

Base access specifier Derived access specifier Derived class access? Public access?

Public Private Yes No

Private Private No No

Protected Private Yes No

Vous aimerez peut-être aussi