KEMBAR78
Q1) Attempt The Following | PDF | C++ | Programming
0% found this document useful (0 votes)
6 views9 pages

Q1) Attempt The Following

The document consists of a series of questions and programming tasks related to C++ concepts, including manipulators, abstraction, encapsulation, inheritance, function overloading, and various types of constructors and destructors. It also includes practical programming exercises that require writing C++ code to demonstrate understanding of these concepts. The questions cover both theoretical explanations and practical applications, indicating a comprehensive assessment of C++ knowledge.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views9 pages

Q1) Attempt The Following

The document consists of a series of questions and programming tasks related to C++ concepts, including manipulators, abstraction, encapsulation, inheritance, function overloading, and various types of constructors and destructors. It also includes practical programming exercises that require writing C++ code to demonstrate understanding of these concepts. The questions cover both theoretical explanations and practical applications, indicating a comprehensive assessment of C++ knowledge.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Q1) Attempt the following [2]

1. Explain manipulators, Enlist manipulators in C++.


2. What is abstraction and Encapsulation?
3. What are the access specifiers used in C++.
4. What is 'this' pointer?
5. What is extraction and insertion operator?
6. What is default argument in function?
7. Write is the uses of scope resolution operator.
8. What is inline function.
9. What are the visibility lables used in C++.
10. Explain tellg() and tellp() with syntax.
11. What is static Polymorphism.
12. Explain structure of C++ program.
13. What is compile - Time polymorphism.
14. List any four features of OOP's.
15. What is cascading of I/O operator?
16. List the ways to define a constant.
17. What is an abstract class?
18. What is Run-Time Polymorphism?
19. Define the following terms
20. Early Binding
21. Late Binding
22. Explain get() and put () function.
23. What is stream?
24. State the need of virtual keyword.
25. State user defined data types in C++.
26. Exception handling.
27. Constructor in derived class
28. Call - by - value and call-by-reference
29. Pointer to object with example.
Q2) Attempt the following [4]

1) What is inheritance and explain the hierarchical inheritance.Explain


types of inheritance.
2) Explain function overloading with example.
3) What is friend function? Write characteristics of friend function.
4) Explain memory management operators with the help of suitable
example.
5) Explain array of object in C++ with example.
6) Explain operator overloading in C++ with an example.
7) What is Destructor? State the importance of destructor with example.
8) Define constructor, List different types of constructor. Explain any one
constructor with example.
9) Explain memory allocation for objects with non-static data member and
static data member.
10)What is class Template? Explain syntax of class template with suitable
example.
11)Explain static data members and static member functions with example.
12)Explain use of any four file opening modes.
13)Explain virtual base class with suitable diagram.
14)Describe file manipulators with their syntaxes.
15)When do we make a class virtual base class? Explain it with suitable
example.
16)Explain any four formatted input/output functions.
17)What is pure virtual function and explain with the help of example
program.
18)Explain Dynamic constructor with suitable example.
19)Explain object as function arguments? Explain with the help of an
example program.
20)Explain try, catch and throw in exception handling.
21)What is tokens in C++? Explain in detail.
22)Explain parameterized constructor with the help of suitable example.
23)Can we pass class object as function arguments? Explain with the help
of an example.
24)Explain various stream classes used to perform console input/output
(I/o) operations.
Q3) Attempt the following [4]

1. Write a C++ program to create a class which contains two data


members. Write member functions to accept, display and swap two
entered numbers using call by reference.

2. Design C++ class which contains function count(). Write a


program to count number of time count() is called. (Use static data
member.)
3. Write a C++ program to create a class Book which contains
data members as B–Id, B–Name, B–Author, B– publication. Write
member functions to accept and display Book information also display
count of books. (Use static data member to maintain count of books)

4. Write a C++ program to copy the contents of a text file into


another text file.
5. Write a C++ program to read contents of a text file and count
number of characters. Words and lines in a file.

6. Write a C++ program to calculate factorial of integer number by


using inline function.

7. Write a C++ program to accept length and width of a rectangle.


Calculate and display perimeter of a rectangle by using inline function.
8. Write a program to calculate area and circumference of a circle
using inline function.
9. Write a C++ program to calculate square and cube of integer
number by using inline function.

10. Write a C++ program to overload the functions to calculate area


of circle, square and rectangle.
11. Write a C++ program to compare two strings using overload
operater “==”.

12. Write a program to perform addition of two matrices using


operator overloading.

13. Write a C++ program to find maximum of two integer numbers


using function template.

14. Write a program to overload binary plus operator to


concatenation of two strings.

15. Write a C++ program to calculate factorial of integer number by


using inline function.

16. Write a C++ program to accept length and width of a rectangle.


Calculate and display perimeter of a rectangle by using inline function.
17. Write a program to calculate area and circumference of a circle
using inline function.
18. Write a C++ program to calculate square and cube of integer
number by using inline function.

19. Write a C++ program to overload the functions to calculate area


of circle, square and rectangle.
Write a C++ program to compare two strings using overload operater
20. Write a program to perform addition of two matrices using
operator overloading.

21. Write a C++ program to find maximum of two integer numbers


using function template.

22. Write a program to overload binary plus operator to


concatenation of two strings.

23. Write a C++ program to create a class customer which contains


data members as C_id, C_name, C_Salary. Write member functions to
accept and display customer information, also display information of
customer having maximum salary.

24. Write a C++ program to create a class product which contains


data members as pname, price, quantity. Write member functions to
accept quantity for n products and accordingly generate and display
bill.

25. Design a base class person (name, address, phoneno). Derive


a class employee (eno,ename) from person derive a class manager
(designation, department, basic-salary) from Employee. Accept all
details of 'n' managers and display manager having highest basic
salary.
26. Declare a class of vehicle. Derived classes are two whecler,
three wheeler and four wheeler. Display the properties of each type of
vehicle using member functions of class.
27. Write a C++ program to use setfile ( ) and setiosflags ( )
manipulator.

28. Write a C++ program to print the following


pattern A
B C

D E F

GH I J
a) Trace the output of the following program and explain it.
Assume there is no syntax error.

# include <
iostream.h > Class
point {
Private :

int x ;
int y ;
Public :

Point (int i, int j); // constructor

};

Point : : Point (int i = 0; int j = 0) {

x = i;
y = j;
cout << “constructor called” ;

int main ()

point + 1, * t2;
return 0;
}
a) Trace output of following program and explain it. Assume there
is no syntax error.

# include <iostream.h>
Class Number
{

Public : int a, b ;

static int cnt ;


Number (int x, int y)
{

cout <<"\n constructor called";

a=x;

b=y;
cnt ++ ;
}

void display ( )

cout <<"\n a =" <<a<< "\n b =" <<b;

int Number : :
cnt ; void main ( )
{ Number N1(4, 6), N2(2, 8);

cout <<"\n Total object created :"

<<Number : : cnt ;

}
[5954]-402 1
a) Trace the output of the following program and explain it. Assume there is
no syntax error.
# include < iostream.h> Class
abc
{

int i; public :
abc (int v = 0)

Cout <<"In the constructor\n''; i = v;


}

Void print (Void)

Cout <<"The value of i is " <<<endl;

};

Void main ( )

abc a (10); abc b ;


a. print ( );

b. print ( );

You might also like