You are on page 1of 2

FALL Semester 2021-2022

Lab Cycle Sheet 2

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


Course Code: ITA3001 Course Title: Object Oriented Programming
Sub Date: Oct 30, 2021 Sub Time: 5 pm

PS 1: Write a C++ program to create a class bank to deposit an amount,withdraw an


amount,balance amount using multiple object.

PS 2: Create a class cylinder with radius and height as data member and perform the
addition of two cylinders using constructor overloading.

PS 3: PS using Friend Function

Create a class Cuboid 1, Cuboid 2 with the below properties:

Cuboid 1 Cuboid 2

Display the Cuboid 3 with the difference between Cuboid 1 and Cuboid 2, and print the
Volume of the Cuboid 3. Write the C++ program using friend function?

Cuboid 3

PS 4: Write and test the following function that returns through its reference
parameters both the maximum and the minimum values stored in an array:

void getExtremes (float a[ ], int n, float& min, float& max);


PS 5: Create a C++ class called Book containing bookTitle, author(s), publication,
yearOfPublication and price as data members. Write functions for the following operations
and test them by creating an array
of Book objects. Also include member functions in the same class for input and output of
data members and perform the following operations.

i) Display the books name sorted in ascending order.


ii) Display the books detail authored by “XXX” ( “XXX” must be
accepted from user)
iii) Display the details of books whose price is greater than 2000.

PS 6: Imagine you are the salesperson in the supermarket and arranging the apples based
on their size (in kgms) every day. One fine day, you decided to scan all the apples size
and arrange it in less time than ever before. The scanner measured the apple’s size, for
example, Apple 1 = 1.4 kgms and 1 kgms, Apple 2 = 1.8 kgms and 2 kgms. This made you
arrange two patterns: Pattern 1 – apple size measured in float, Pattern 2 – apple size
measured in integer. Design a C++ program to implement this given use case?

PS 7: Design a menu-based calculator to perform arithmetic operations (+,_,*,/,%) using


operator overloading concept that demonstrates the following:
Enter the number 1: 45
Enter the number 2: 5
Addition = 50
Sub = 40
Mul = 225
Div= 9
Modulo = 0
Do you wish to continue(Y/N): Y
Enter the number 1: 40
Enter the number 2: 3
Addition = 43
Sub = 37
Mul = 120
Div= 13
Modulo = 1
Do you wish to continue(Y/N): N

You might also like