Create Bank Account using C++

July 25, 2010 at 18:02:48
Specs: Windows 7
I have no any experiences in any programming language before C++, thus my question might seem easy.

Thanks for all the advise

Below is the assignment:
1. Define a BankAccount class as follows:
a. Declare four fields: account number (int), Account type (string), owner’s name (String), current balance (double). All fields have private access.
b. Declare a static field, NextAcntNbr, of type int. Initialize its value to 10001. Whenever a new account is created, value of this field is used as the Account Number of the new account. Its value is then incremented by one.
c. Define a constructor which assigns the account number of the new account. It also set the owner’s name and balance with the values it receives through the parameters. Set the account type as “GA” to indicate that this is a general account.
d. Define a debit method which subtracts a given positive amount from the current balance, then prints the information about this account. If there is not enough balance in the account, an error message should be printed.
e. Define a credit method which adds a given positive amount to the current balance, then prints the information about this account.
f. Define a getBalance method which returns the current balance.
g. Define a printAccount method which prints all the fields of an account.
2. Define a main method to test the BankAccount implementation. The main method should do the following:
a. Create an array object capable of storing 10 BankAccount objects.
b. Create several BankAccount objects and store them into the array.
c. Invoke the debit, credit, and getBalance methods to do some transactions. Make sure you print out some information about each transaction.
d. You may use a loop to perform steps b and c. Tasks inside the loop can be:
- display welcome message;
- ask user the transaction type (create new account, debit, credit, check balance, quit), then invoke proper method.
Or, you may want to just hardcode some test cases in your program to exercise all those methods. It’s your choice.

1. Run your program to create at least three test accounts. The first account should use your name as the owner. All the methods must be invoked at least once. Turn in both the program listing and the input/output dialog to show that your program runs correctly.

See More: Create Bank Account using C++

Report •

July 25, 2010 at 18:35:52
Awesome. When you get past the, "Have people on the Internet do my homework for free" stage, let us know.

If you start doing your homework yourself, but run into problems, feel free to ask us. Make sure to include the code you're having problems with.

If you prefer to have the Internet to do your homework, well, that's an option, too.

Report •
Related Solutions

Ask Question