Task: Create a BankAccount class with Constructor Overloading
Objective:
The objective of this task is to practice constructor overloading and understand how to initialize
objects with different constructors based on the provided data.
Instructions:
1. Create a class named BankAccount. This class should have the following private
member variables:
o string accountHolderName (Name of the account holder)
o string accountNumber (Account number)
o double balance (Balance in the account)
2. Create three constructors (constructor overloading):
o Default Constructor: Initializes the accountHolderName to "Unknown",
accountNumber to "0000000000", and balance to 0.0.
o Parameterized Constructor 1: Initializes the accountHolderName,
accountNumber, and balance with specific values provided by the user.
o Parameterized Constructor 2: Initializes the accountHolderName and
accountNumber with specific values but sets the balance to a default value of
1000.0.
3. Add a member function to display the account details:
o This function will display the account holder's name, account number, and
balance.
4. In the main() function:
o Create three objects of the BankAccount class: one using the default constructor,
one using the parameterized constructor with all three values, and one using the
parameterized constructor with name and account number (balance should
default to 1000.0).
o Display the details of each bank account using the display function.