Object oriented programming
All OOP assignments submission :-
Name: Akhil Hegde
Rollno: 56
PRN: 12411152
Branch:- CSSE
Div and batch: A-3
1a) code and output:
1b)
1c)
1d)
Assignment 2
2a)
Factorial using Recursion:
2b)
Prime Number Check
Assignment 3
3a) Rectangle class:
3b)banking class code:-
Output:-
3c) static data members:
3d) This pointer
3e) operator overloading with friend function
3f) comparative operator overloading
Code:-
Ouput:-
Assignment 4
4a) a) Build a hierarchy of classes representing different shapes (e.g., Circle,
Triangle, Rectangle) with a common base class. Implement a virtual function
for calculating the area of each shape.
Code:-
Output:- first is area of circle with radius 5 and second is rectangle with
length 6 and breadth 4.
4b) b) Extend the banking system to include different types of accounts
(Savings, Checking) that inherit from a common Account class. Implement
polymorphic behaviour for interest calculations.
Code:-
Output:-
Assignment 5:
Write a program using try, catch, and throw for arithmetic
and input errors.
Code:-
Output:-
Assignment 6
Write a function template for finding the maximum of two values.
Code and output:-