Fill This Form To Receive Instant Help
Homework answers / question archive / As you write your program code, you will separate your code into different files
As you write your program code, you will separate your code into different files. You will create header files and cpp source files for each class. You will place the class declaration in a header file, and your class method implementations will go in a cpp source file. Your main function will go in yet another cpp source file. All of your cpp source files will include your header files as needed.
**Each task should at least have 3 or more files, 2 cpp files and 1 header file. You may reuse your code to accomplish each task. i.e., the code in task 1 can be reused in task 2 and 3.
Standard Template Library and Iterators
Task#1: Upgrade the bank system to handle more than one account.
Example Output.
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
Your choice: 4
Enter the name: George
Enter the balance: 100
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
Your choice: 4
Enter the name: Harry
Enter the balance: 200
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
Your choice: 2
Enter the ID of the account to find: 0
Found account: Account ID: 0 Name: George Balance: $100.00
Amount to deposit: 15
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
Your choice: 3
Enter the ID of the account to find: 1
Found account: Account ID: 1 Name: Harry Balance: $200.00
Amount to withdraw: 25
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
Your choice: 1
Account ID: 0 Name: George Balance: $115.00
Account ID: 1 Name: Harry Balance: $175.00
Algorithms
Task#2: Upgrade the bank system to include additional operations: remove an account, show total bank deposits, and pay dividends.
Example Output
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
6. Remove account
7. Show total balance for all accounts
8. Add a dividend to all accounts
Your choice: 4
Enter the name: George
Enter the balance: 100
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
6. Remove account
7. Show total balance for all accounts
8. Add a dividend to all accounts
Your choice: 4
Enter the name: Harry
Enter the balance: 200
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
6. Remove account
7. Show total balance for all accounts
8. Add a dividend to all accounts
Your choice: 8
Enter the dividend as a percentage: 5
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
6. Remove account
7. Show total balance for all accounts
8. Add a dividend to all accounts
Your choice: 1
Account ID: 0 Name: George Balance: $105.00
Account ID: 1 Name: Harry Balance: $210.00
This contact class will have a constructor that takes no parameters. In this constructor, all of the data values will be given blank values or empty strings.
This contact class will have a copy constructor that copies all of the data members from one instance to another. The source instance should be passed by reference.
This contact class will have a destructor. This destructor will have an empty body. We'll add more code here later.
This contact class will have a method to ask the user for the values to store in the data members.
This contact class will also have a method to show the data members. This method will take an output stream reference as a parameter and return the same stream reference as the return value.
The account class will contain an additional data member: a smart pointer that contains the contact information. In the constructors for the account class, initialize this smart pointer to nullptr.
Add a method to the account class that is used to add the contact info. This must be done as a method in the account class because we are modifying a data member of the class.
Add a menu item to attach contact information to an account. This menu option will find an account to modify, and call the method to add the contact information.
Example Output
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
6. Remove account
7. Show total balance for all accounts
8. Add a dividend to all accounts
9. Add contact information to an account
Your choice: 4
Enter the name: George
Enter the balance: 100
In Account destructor (name is George)
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
6. Remove account
7. Show total balance for all accounts
8. Add a dividend to all accounts
9. Add contact information to an account
Your choice: 4
Enter the name: Harry
Enter the balance: 200
In Account destructor (name is Harry)
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
6. Remove account
7. Show total balance for all accounts
8. Add a dividend to all accounts
9. Add contact information to an account
Your choice: 9
Enter the ID of the account to find: 1
Found account: Account ID: 1 Name: Harry Balance: $200.00
Enter Address: 123 Main St
Enter City: Nowhere
Enter State: UT
Enter Zip Code: 84000
Enter Phone Number: 123-456-7890
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
6. Remove account
7. Show total balance for all accounts
8. Add a dividend to all accounts
9. Add contact information to an account
Your choice: 1
Account ID: 0 Name: George Balance: $100.00
Account ID: 1 Name: Harry Balance: $200.00
+ Contact Information: Address: 123 Main St City: Nowhere State: UT Zip: 84000 Phone: 123-456-7890
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
6. Remove account
7. Show total balance for all accounts
8. Add a dividend to all accounts
9. Add contact information to an account
Your choice: 6
Enter account ID to remove: 1
In Account destructor (name is Harry)
In Contact destructor (address is 123 Main St)
Account Menu:
0. Quit Program
1. Display Account Information
2. Add a deposit to an account
3. Withdraw from an account
4. Add new account
5. Find account by ID
6. Remove account
7. Show total balance for all accounts
8. Add a dividend to all accounts
9. Add contact information to an account
Your choice: 1
Account ID: 0 Name: George Balance: $100.00