Posts

Showing posts from March, 2026

OOPS LAB - TYPE CONVERSIONS IN C++

  Program 1: Currency Conversion System Question: Design a C++ program to convert currency using different types of type conversion. Requirements: Create a class Rupee to store amount in INR. Create a class Dollar to store amount in USD. Convert: Basic → Class (float to Rupee) Class → Class (Rupee to Dollar) Class → Basic (Dollar to float) Assume conversion rate: 1 USD = 80 INR . Display all values. Additional Tasks: Identify which constructor/operator performs each conversion. Comment on precision loss. Program 2: Distance Conversion System Question: Develop a C++ program for distance conversion using multiple classes. Requirements: Create classes: Meter , Kilometer , Centimeter . Convert: Basic → Class (int to Meter) Class → Class (Meter → Kilometer → Centimeter) Display all converted values. Additional Tasks: Explain chaining of conversions. What happens if explicit casting is removed? Program 3: Studen...

OOPS LAB - INHERITANCE

  Ex 6 A- Multilevel Inheritance   Set 1. Student Result System Classes: Student → Marks → Result Tasks: Read student ID and name in class Student. Read marks of three subjects in class Marks. Calculate total marks in class Result. Calculate average marks. Display the complete student result. Set 2. Employee Salary System Classes: Employee → Salary → TotalSalary Tasks: Store employee ID and name. Store basic salary and allowance. Calculate gross salary. Calculate annual salary. Display complete employee salary details. Set 3. Vehicle Information System Classes: Vehicle → Car → SportsCar Tasks: Store vehicle number and brand. Store fuel type and mileage. Store maximum speed and price. Display full vehicle details. Calculate fuel needed for a given distance. Set 4. Bank Account System Classes: Account → SavingsAccount → Transaction Tasks: Store account number and holder name. Store balance a...