Constructors, Lab 5
Constructors, Lab 5
TASKS
TASK 1
You are tasked with creating a Bank Account Management System in C++ using Object-Oriented
Programming (OOP) principles. The system should allow the creation of a bank account, deposit and
withdraw funds, and display the account details. The system should handle basic operations such as
deposits, withdrawals, and balance checks.
Requirements:
1. Class Design:
2. Program Flow:
▪ View account details (account number, account holder's name, and balance).
Task 2:
You are required to implement a C++ program that demonstrates the use of constructors in an object-
oriented manner. The program should create a class that represents a simple Book with attributes such
as title, author, and price. The class should use a constructor to initialize these attributes and a
destructor to clean up or display a message when the object is destroyed.
Requirements:
1. Class Design:
2. Program Flow:
o In the main() function, demonstrate the creation of a Book object using the constructor.
o The destructor should automatically be called when the object goes out of scope (i.e.,
when the program finishes execution or when the object goes out of scope).
Task 3:
You are required to implement a C++ program that demonstrates the use of constructors and
destructors in an object-oriented manner. The program should create a class that represents a simple
Book with attributes such as title, author, and price. The class should use a constructor to initialize these
attributes and a destructor to clean up or display a message when the object is destroyed.
Requirements:
1. Class Design:
2. Program Flow:
o In the main() function, demonstrate the creation of a Book object using the constructor.
o The destructor should automatically be called when the object goes out of scope (i.e.,
when the program finishes execution or when the object goes out of scope).