Posts

Showing posts from April, 2026

EX NO 8B: OOPS LAB - FUNCTION TEMPLATE

  EX NO 8B: Function Template 1. Multi-Type Banking Transaction Analyzer ( RNO – 1 TO 5) Problem Statement: Design a program using function templates to perform multiple banking operations (deposit, withdrawal, interest calculation) for different numeric data types. Maintain transaction history and validate all operations. Steps: Define function templates for deposit, withdraw, and interest calculation Accept initial balance Use loop to display menu (Deposit / Withdraw / Interest / Exit) For deposit: validate amount > 0 and update balance For withdrawal: check sufficient balance before deduction For interest: calculate based on formula Store each transaction in an array Display transaction history Repeat until user exits 2. Generic Data Analyzer System ( RNO – 6 TO 10) Problem Statement: Develop a program using function templates to analyze a dataset (array) by calculating sum, average, variance, and standard deviation for ...

EX NO 8A: OOPS LAB - CLASS TEMPLATE

  EX NO 8A: Class Templates   1. Generic Bank Account System   ( RNO – 1 TO 5) Steps: Define a class template Account<T> Declare data members: balance (T), account holder name Initialize balance using constructor Create function deposit(T amount) Check if amount > 0 Add amount to balance Create function withdraw(T amount) Check if amount <= balance Deduct amount, else display “Insufficient Balance” Create function to display account details In main(), create multiple objects with different data types Perform multiple transactions Display updated balance after each transaction 2. Student Management System ( RNO – 6 TO 10) Steps: Define class template with parameters <T1, T2, T3> Declare roll number, name, and marks Create constructor to initialize values Create function to calculate grade based on marks Create function to display student details with grade Allow...

EX NO 7 : OOPS LAB - FUNCTION OVERLOADING

Image
  EX NO 7 – Function overloading Set 1. Smart Calculator with Mode-Based Operations ( ROLL NUM - 56 TO 61) Function: calculate() Overloads: calculate(int a, int b, char op) Perform operation based on op '+' → addition '-' → subtraction '*' → multiplication '/' → division (handle divide-by-zero) calculate(double a, double b) Always perform division and return precise result calculate(int a) Return square of number Set   2. Student Evaluation System  ( ROLL NUM - 6 TO 10) Function: evaluate() Overloads: evaluate(int marks) Assign grade: ≥90 → A ≥75 → B ≥50 → C <50 → Fail evaluate(int marks, int attendance) If attendance > 85%, add 5 bonus marks Then compute grade evaluate(string grade) Print remark: A → Excellent B → Good C → Average Fail → Needs Improvement Set   3. Password Validation Syste...