Create a class in C++ name Account with the following Data members
• AcNumber
• AcHolderName
• AcBalance
• Actype
• AcMinBalance
And the following member Functions
Identifier Return type Parameters
CreateNewAccount Boolean Integer AcNumber,
StringAcHolderName,
String AcType,
Long Deposit
ShowAcInfo void void (No parameters )
ShowAcInfo void String InfoType
In the CreateNewAccount member function the Deposit parameter must be assigned to the AcBalance field and others to their respective fields. Depending on the AcType value,the AcMinBalance field must be set. The following table provides us the required information
AcType Value MinBalance
Savings 10000
Current 25000
If the deposit is less than MinBalance then the method must exit returning bolean value False or True.
Note that there are two ShowAcInfo() methods .The first one accepts no parameters,while the second takes in a string parameter (overloaded).
ShowAcInfo() that’s takes in no parameters print all the field values except the AcMinBalance field ,to the user’s console(screen).
The second ShowAcInfo() method takes in one string parameter (InfoType).This parameter must have one of the following values.
InfoType Should Display
ShortInfo AcNumber,AcBalance
LongInfo All data members of the object
Additionally the class must also have
• Default constructor, which must set AcType to “Savings” and AcMinBalance to 10000.
• Parameterized constructor which takes in all the fields as parameters and assigns them to their respective fields
• Set and Get functions for all data members of class
• Destructor with no implementation (leave body of destructor empty)
In main function create object of Account class and create a new account by calling CreateNewAccount function for that object.
If new account not created successfully then display a message on screen “Your account cannot be opened”.
If new account created successfully then sample outputs are given below:
Sample Output 1:
Your Account has been opened successfully.
Enter ‘L’ for Long information of your Account.
Enter ‘S’ for Short information of your Account.
L
Account Number : 1
Account Holder Name: Ahmer Waqas
Account Balance : 15000
Account Type : Saving
Sample Output 2:
Your Account has been opened successfully
Enter ‘L’ for Long information of your Account.
Enter ‘S’ for Short information of your Account.
S
Account Number : 1
Account Balance : 15000