Practical no: 15
Output:
Practical no: 16
Output:
Practical no: 17
Output:
Practical no: 18
Output:
Practical no: 19
Output:
Practical no: 20
Output:
Practical no: 21
Output:
Practical no: 22
Output:
Practical no: 12
Output:
Practical no: 13
Output:
Index
Sr.No Date Topic Sign
1. Conditional Statements
a. Write a program to check whether the number is even or odd.
b. Write a program to check whether the number is positive,
negative or zero.
2. Loops
a. Write a program to find the sum of numbers from 1 to 100.
b. Write a program to find the factorial of a number.
3. Array
a. Write a program to find the largest value that is stored in the
array.
b. Write a program using pointers to compute the sum of all
elements stored in an array.
4. Pointer
a. Write a program to demonstrate the use of pointers.
b. Write a program to perform addition and subtraction of two
pointer variables.
5. Classes and methods
a. Design an employee class for reading and displaying the
employee information, the getInfo() and displayInfo() methods will
be used respectively. Where getInfo() will be private method.
b. Design the class student containing getData() and displayData()
as two of its methods which will be used for reading and displaying
the student information respectively. Where getData() will be
private method.
c. Design the class Demo which will contain the following methods:
readNo(), factorial() for calculating the factorial of a number,
reverseNo() will reverse the given number, is Palindrome() will
check the given number is palindrome, is Armstrong() which will
calculate the given number is Armstrong or not. Where readNo()
will be private method.
d. Write a program to demonstrate function definition outside class
and accessing class members in function definition.
6. Using friend functions.
a. Write a friend function for adding the two complex numbers,
using a single class.
b. Write a friend function for adding the two matrix from two
different classes and display its sum.
7. Constructors and method overloading.
a. Design a class Complex for adding the two complex numbers and
also show the use of constructor.
b. Design a class Geometry containing the methods area() and
volume() and also overload the area() function .
c. Design a class StaticDemo to show the implementation of static
variable and static function.
8. Operator Overloading
a. Overload the operator unary (-) for demonstrating operator
overloading.
b. Overload the operator + for adding the timings of two clocks, and
also pass objects as an argument.
c. Overload the + for concatenating the two strings. For e.g. “Py” +
“thon” = Python.
9. Inheritance
a. Design a class for single level inheritance using public and private
type derivation.
b. Design a class for multiple inheritance.
c. Implement the hierarchical inheritance.
10. Virtual functions and abstract classes
a. Implement the concept of method overriding.
b. Show the use of virtual function.
c. Show the implementation of abstract class.