How do you create more than one account and
store a new account to your bank program in
C++?
Requirements:
1. This "add new account" option will only be created when the user
selects it.
2. A standard template library should be used to hold the accounts
i.e. list container type.
3. Create a function that finds the desired account but if the
account doesn't exist in the list, display an error message.
When you write your code, please separate them into different
files. 1.) The class declaration should be in a header
file and 2.) class implementation should be in a
cpp file. 3.) The other cpp file will be the main
function.
Your program code should be identical to the output bellow.
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: Skyler
Enter the balance: 150
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: Lilly
Enter the balance: 300
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: Skyler Balance: $150.00
Amount to deposit: 50
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: Lilly Balance: $300.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: Skyler Balance: $150.00
Account ID: 1 Name: Lilly Balance: $275.00
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: 5
Enter the ID of the account to find: 2
Account not found.
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: 5
Enter the ID of the account to find: 0
Found account: Account ID: 1 Name: Skyler Balance: $150.00
How do you create more than one account and store a new account to your bank program in C++? Requirements: 1. This "add
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
How do you create more than one account and store a new account to your bank program in C++? Requirements: 1. This "add
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!