You are on page 1of 3

FALL Semester 2021-2022

Lab Cycle Sheet


Programme Name & Branch: B.C.A. Slot: L49+L50

Course Code: ITA3001 Course Title: Object Oriented Programming

Sub Date : 13.11.2021 Sub Time: 5 pm

Problem Statement 1 using Single Inheritance:

Employee
ENo,Ename,Designation
Get()

Salary
Bp (Basic Pay),
Hra(House Rent Allowance),
Da (Dearness Allowance),
Pf (Profitability Fund),
np (Net Pay)
Get1() – bp,hra,da and pf
Calculate() – np = bp+hra+da-pf
Display() – emp data
(ENo,Ename,Designation, Salary)

Problem Statement 2 using Single Inheritance:

Customer
CusID, CusName,
PhoneNo
Getdata()
Printdata()

WaterBill
No. of Litres Consumed
(Lit_Consumed)
Compute_Bill()
PrintBill()
Litres_Consumed <=50 => BillAmount = Lit_Consumed * 1.50
Litres_Consumed <= 150 => BillAmount = (50*1.5) + (Lit_Consumed - 50) * 2.00
Litres_Consumed <= 250 => BillAmount = (50*1.5) + ((150-50) *2.00 ) +
(Lit_Consumed -150)*3.00
Litres_Consumed > 250 => BillAmount = (50*1.5) + ((150-50) *2.00 ) + ((250-150)
*3.00) + (Lit_Consumed - 250) * 4.00
PS 3: Generic Programming
Consider there are ‘n’ children in the class. Assume you are the class teacher of the class
and want to find the class topper. Develop a C++ program using generic programming
concept by reading 5 subjects marks – English, Math, Social Science, History and Science.
The class topper is determined with the highest total marks secured. Display the class
topper detail – Name, Roll NO, Marks of 5 subjects and the Total Marks.

PS 4: Write a C++ program that contains a base class where the user enters a complex
number. Create two derived classes of which the first derived class performs complex
number addition and second derived class performs complex number subtraction. Note
that the second derived class should be made as a friend of first derived class such that the
subtraction will be calculated using base class and first derived class complex number?

Sample Input and Output:

Enter the complex number of base class:


Enter the real part: 4
Enter the imaginary part: 3

Enter the complex number for derived class:


Enter real part: 2
Enter imaginary part: 1
After addition the result is :
6 + 4i

Enter the complex for friend class:


Enter real part: 7
Enter imaginary part: 6
After subtraction the result is :
3 + 3i

PS 5: C++ program to add two numbers using function template

PS 6: C++ Program to find the square of a given number using function template
PS 7: Implement the C++ Program using operator overloading concept for performing the
below operations:
1. Adding two Time Objects (hr:min:sec).
2. Comparing two Time Objects (hr:min:sec).
Design the solution by implementing the program using the following approaches:
1. Member Function.
2. Non-Member Function.
3. Friend Function.

You might also like