The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 313 Weeks Ago, 6 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Language is C++
Due July 13 at 11.59 pm
I need help ASAP, my apology for not having enough time.
Thanks
Â
This homework assignment gives you the opportunity to practice classes, member variables, member functions.
Design a bank account class named Account that has the following private member variables:
•      accountNumberof typeint
•      ownerNameof type string
•      balance of type double
Â
and the following public member functions:
•      Account() constructor with no arguments, that creates a bank account with a default accountNumber as 9999, a name of an empty string, and balance value of zero. An Account object is dynamically allocatedÂ
•      Account(number, name, bal) constructor with three parameters, that creates a bank account with a specified accountNumber, name and balance. An Account object is dynamically allocated
•      withdraw(amount) function to withdraw a specified amount from the account. The function should first check if there is sufficient balance in the account. If the balance is sufficient, withdrawal is processed. Otherwise the withdrawal is not made.
•      deposit(amount) function to deposit a specified amount of money to the account. The
function should first check if the deposit amount is positive. If it is positive, deposit is processed. Otherwise the deposit is not made.
•      getAccountNumber(): An accessor function that returns the account number. This function is later called by the displayAccountInfo() function.
•      getName(): An accessor function that returns the name on the account.
•      getBalance(): An accessor function that returns the account balance. This function is later called by the displayAccountInfo() function.
Demonstrate the class in a program. 1.Additional Requirements
Your code should be structured into the following files:
•      Account.h which contains the class definition and the function prototypes of all the member functions
•      Account.cpp which contains the function description of all the member functions ï‚·Main.cpp file which contains the main function.Â
Define a global array of pointers to Account, of size MAX_NUM_ACCOUNTS (set MAX_NUM_ACCOUNTS to 5).Â
Loop on displaying the following menu of choices:
1. Create account with complete information (user will be prompted for account number, name and amount)
2. Create default account with no parameters.
3. Deposit to account (user will be prompted for account number and amount)
4. Withdraw from account (user will be prompted for account number and amount)
5. Display information for all accounts 6.Exit the program.
Â
In addition to the member functions, you should implement displayAccountInfo(), which is not a member function, but a stand-alone function. displayAccountInfo() is called inside the main function. displayAccountInfo() takes as argument a particular Account object and displays the account number, owner’s name and balance for that object. d)Input validation
•      Show an error message if the user tries to deposit to or withdraw from an account number that doesn’t exist. Your program should perform a search on the account number.
•      Show an error message if the user attempts to create an account number that already exists. Your program should perform a search on the account number to verify the account number does not already exist.
•      Show an error message if the withdrawal amount exceeds the balance. No withdrawal should be made in that case.
•      Show an error message if the deposit amount is not positive. No deposit should be made in that case.
•      Do not accept to create an account if the maximum number of accounts has been reached
(MAX_NUM_ACCOUNTS)
Make sure you follow the style requirements, especially regarding the comment header for functions, to avoid losing points.
2.Suggestions for implementation
When a member function does input validation and detects an invalid input, do not cout an error message in the member function, but instead have the function return an error indication to the calling function. The calling function will then cout an error or perform other appropriate actions. With that method, your class is usable even when input/output other than the keyboard/screen are used. To take the withdraw member function as an example:
/* This function checks the amount to be withdrawn does not
exceed the balance. If the amount does not exceed the balance, the withdrawal is performed, and the function returns true. Else no withdrawal is done, and the function returns false.
*/
bool Account::withdraw(double amnt)
{
// Function definition
}
3.Expected Output
To test your program, type the same input as in the screenshots below, and check the output of your program matches the screenshots.
Â
Continued below

Continued below

Continued below

Â
Â
Â
Â
Â
Â
Â
Attachments:
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly