VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur – 603 203 DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK VI SEMESTER CS6301-PROGRAMMING DATASTRUCTURE II Regulation – 2013 Academic Year 2017 – 18 Prepared by Ms. R.Thenmozhi, Assistant Professor (Sel.G)/IT Ms. K.Mohanambal, Assistant Professor (O.G)/IT
21
Embed
VALLIAMMAI ENGINEERING COLLEGE Semester/CS6301-Programming and...VALLIAMMAI ENGINEERING COLLEGE ... Illustrate and write a C++ program that prints the factorial of a given number using
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
VALLIAMMAI ENGINEERING COLLEGE
SRM Nagar, Kattankulathur – 603 203
DEPARTMENT OF INFORMATION TECHNOLOGY
QUESTION BANK
VI SEMESTER
CS6301-PROGRAMMING DATASTRUCTURE II
Regulation – 2013
Academic Year 2017 – 18
Prepared by
Ms. R.Thenmozhi, Assistant Professor (Sel.G)/IT
Ms. K.Mohanambal, Assistant Professor (O.G)/IT
VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur – 603 203.
DEPARTMENT OF INFORMATION TECHNOLOGY
QUESTION BANK SUBJECT : Programming and Data Structures II
SEM / YEAR: III Sem/ II Year
UNIT 1 – OBJECT ORIENTED PROGRAMMING FUNDAMENTALS
Be familiar with the C++ concepts of abstraction, encapsulation, constructor, polymorphism, overloading and
Inheritance.
C++ Programming features – Data Abstraction – Encapsulation – class – object – constructors – static members – constant members – member functions – pointers – references – Role of this pointer – Storage classes – function as
arguments.
PART – A
Q.No. Questions
BT
Level Competence
1 Define Data Abstraction. BTL-1 Remembering
2 What is the use of “this” pointer? BTL-1 Remembering
3 Which is used for achieving data Hiding in C++? BTL-1 Remembering
4 List the various storage classes available in C++. BTL-1 Remembering
5 What is the significance of static data & static member function in
object oriented programming?
BTL-1 Remembering
6 Define Encapsulation. BTL-1 Remembering
7 Give the significance of declaring a member of a class static. BTL-2 Understanding
8 Give the characteristics of the constructor function. BTL-2 Understanding
9 Differentiate between realloc () and free (). BTL-2 Understanding
10 Give the features of object oriented C++ programming. BTL-2 Understanding
11 Show the working of copy constructor. BTL-3 Applying
12 What is a default constructor? Illustrate. BTL-3 Applying
13 What are objects? Illustrate with an example. BTL-3 Applying
14 Point out a when a function will be made online? BTL-4 Analysing
15 What are pointers? Point out the advantages of using pointers in
programming.
BTL-4 Analysing
16 Analyze and define operator overloading with an example. BTL-4 Analysing
17 Compare the working of structures and classes in C++. BTL-5 Evaluating
18 Summarize the working of destructors with an example. BTL-5 Evaluating
19 Develop the member function to find the greater of two numbers
using “this” pointer.
BTL-6 Creating
20 Develop a simple C++ program using a class concept. BTL-6 Creating
PART – B
1 (i) List the types of constructors with examples. (6)
(ii) Describe the features of C++ programming Language . (7)
BTL-1 Remembering
2
(i) Describe the ways in which member functions of class can be
defined & called using a suitable example. (7)
(ii) Describe with an example the use of static members. (6)
BTL-1 Remembering
3
(i) What are the differences between pointer to constant & constant to
pointer? Give an example program & explain it. (7)
(ii) Describe the role of “this” pointer with an suitable program. (6)
BTL-1 Remembering
4 Explain the different types of storage classes of C++ using suitable
examples. (13)
BTL-1 Remembering
5 Discuss about the need to use the default arguments with an example
program. (13)
BTL-2 Understanding
6 (i) Describe about the copy constructor with an example. (7)
(ii) Differentiate between constructor and destructor. (6)
BTL-2 Understanding
7
Describe briefly about the following term with an suitable example:
(i) Objects. (3)
(ii) Classes. (3)
(iii) Polymorphism. (3)
(iv) Methods and message passing. (4)
BTL-2 Understanding
8
(i) Illustrate and write a C++ program to check how many instances of
a class are created using the static member function. (7)
(ii) Illustrate and write a C++ program that prints the factorial of a
given number using a copy constructor and destructor member
function. (6)
BTL-3 Applying
9
(i) How would you declare function to be a constant in C++? What are
the properties of such function? Demonstrate with a program. (7)
(ii) Demonstrate the mechanism for accessing data members and
member functions in the following cases. (6)
a. Inside the main program.
b. Inside a member function of the same class
c. Inside a member function of another class
BTL-3 Applying
10 Explain about constructors and destructors with example program. (13) BTL-4 Analysing
11
(i)What do you mean by static member function? Explain in detail with an
example. (7)
(ii) Point out a detailed note on const member function. (6)
BTL-4 Analysing
12
(i) Pointout the advantages of OOP? (3)
(ii)Explain in detail about const,volatile and static functions. (10)
BTL-4 Analysing
13
Summarize the various function call mechanisms with suitable
programming example. (13)
BTL-5 Evaluating
14
Develop an object oriented program in C++ to prepare the mark sheet
of a university exam with the following items read from the keyboard.
Name of the student, Rollno, Subjectname, Subjectcode,
Internalmarks, and External marks.
Design a base class consisting of the data members such as name of the
student, roll number and subject code, internal marks and external
marks. The program should be able to do the following tasks” Build a
table, Display the table, Insert into the table, Delete from the table,
Edit entry and search for a record that is needed to be printed. (13)
BTL-6 Creating
PART - C
1
Define a class time with string containing seconds elapsed till midnight
(12.00AM) as a single data member. Write AddTime function which
adds two different Time objects and returns a new Time object. Write a
Display Normal function which converts the time in seconds and
display in a normal fashion HH:MM:SS. (15)
BTL-6 Creating
2
(i) Write a program in C++ that contains a function which takes an
integer array as argument and returns the sum of the array elements.(7)
(ii)Construct a class by name ‘Box’ with a constructor method and
volume method. Constructor initializes the length, breath, and height
of the box objects. Volume method computes the volume of the box
using the formula length*breath*height. Create three box objects and
compute their volume by declaring a pointer to the box class. (8)
BTL-5 Evaluating
3
(i)Write a C++ Program to find the smallest in an array of ‘n’ elements
using pointers. (7)
(ii)Write a C++ program to sort a list of strings using pointers. (8)
BTL-6 Creating
4
Consider an example of declaring the examination result. Design three
classes: student, Exam and result. The “student” class has data
members such as that representing roll number, names etc.create the
class “Exam” by inheriting the “student” class. The “Exam” class adds
data members representing the marks scored in six subjects. Write an
interactive program to model this relationship. what type of inheritance
this model belongs to? (15)
BTL-5 Evaluating
UNIT 2 – OBJECT ORIENTED PROGRAMMING CONCEPTS
String Handling – Copy Constructor – Polymorphism – compile time and run time polymorphisms – function overloading – operators overloading – dynamic memory allocation – Nested classes - Inheritance – virtual functions
PART – A
Q.No. Question BT
Level Competence
1 List any four operators of C++ that cannot be overloaded. BTL-1
Remembering
2 What are pure virtual functions? Give example BTL-1 Remembering
3 Tell how the ‘C’ string differs from a C++ type string? BTL-1 Remembering
4 What is dynamic initialization of objects? BTL-1 Remembering
5 Define copy constructor & its use. BTL-1 Remembering
6 State the uses of virtual functions. BTL-1 Remembering
7 Distinguish the term overloading &overriding. BTL-2 Understanding
8 Summarize the different operators of C++ that can be overloaded.
Give an example
BTL-2 Understanding
9 Differentiate virtual function and pure virtual function. BTL-2 Understanding