Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need assitsance in golang please. In this activity, you will create a banking terminal that allows a user to manage their bank account. Set Up
need assitsance in golang please.
In this activity, you will create a banking terminal that allows a user to manage their bank account. Set Up the Structs Start by creating the following structs. Use an appropriate name for each struct. Bank Account Create a struct to represent the accounts. Include the following information: Account number: string Account owner: struct of type entity o The struct entity should include ID Address Entity type: string (Individual or Business) Balance: float64 o Interest rate: float64 Account Type: String (checking, savings, or investment) Wallet Create a struct to group accounts by owner: . Wallet ID: string Accounts: the different accounts in the wallet (Choose appropriate data structure) Wallet owner: struct of type entity Define the Methods Implement the following methods for the account struct: Withdraw method: Implement necessary logic to validate balance before performing a withdrawal. Check that balance is greater than the amount to be withdrawn and that the balance is not negative. o The withdraw method should take as input the amount to be withdrawn. Deposit method. This method should take as input the amount to be deposited. Apply interest: This method should apply an interest rate to the balance of the account as follows: For individual accounts: 1% APR for checking accounts 2% APR for investment accounts 5% APR for saving accounts o For business accounts: 0.5% APR for checking accounts 1% APR for investment accounts 2% APR for saving accounts Wire: The method should mimic wiring money to another account. The accounts can be owned by the same entity or by different entities. The method will need the source account and the target account. o The method will need the amount to be wired. The method will deduct the amount from the source (after checking the validity of the amount) and add it to the target. Implement the following method for the entity account: Change address: changes the address of the entity Implement the following methods for the wallet struct Display Accounts: Iterate and display the information on each account in the wallet. o The method should display the accounts in the following order: The checking accounts first The investment accounts second The saving accounts last Balance: Iterate through all accounts and return the overall balance in all accounts Wire: This method will mimic a wire from a source account to a target account The source account must be in the wallet The target account can be in the wallet or external. If the account doesn't have enough balance, display an error message Main Function Create a main function that can: Create account, entity, and wallet types Showcase the different methods implemented, based on the user interaction with the accounts. . Challenge After you have the basic program working as expected, add the following updates: Create a nice banking terminal. The terminal will allow user to View accounts Interact with accounts (deposit, withdraw, etc.) View the wallet Interact with the wallet Identify at least one design change that will make the structs and our program more elegant and efficient. Design changes can include Adding new attributes Adding new structs Implement new methods Instead of an error message, the wire method should recommend another account in the wallet that has enough balance to perform the transfer. Can you change the Account and wallet struct, so we are able to compute the overall interest rate paid to all the accounts in the wallet? o You will need to store the interest amount somewhere each time you apply interest to a particular account. Use appropriate data structures and logic to implement it. In this activity, you will create a banking terminal that allows a user to manage their bank account. Set Up the Structs Start by creating the following structs. Use an appropriate name for each struct. Bank Account Create a struct to represent the accounts. Include the following information: Account number: string Account owner: struct of type entity o The struct entity should include ID Address Entity type: string (Individual or Business) Balance: float64 o Interest rate: float64 Account Type: String (checking, savings, or investment) Wallet Create a struct to group accounts by owner: . Wallet ID: string Accounts: the different accounts in the wallet (Choose appropriate data structure) Wallet owner: struct of type entity Define the Methods Implement the following methods for the account struct: Withdraw method: Implement necessary logic to validate balance before performing a withdrawal. Check that balance is greater than the amount to be withdrawn and that the balance is not negative. o The withdraw method should take as input the amount to be withdrawn. Deposit method. This method should take as input the amount to be deposited. Apply interest: This method should apply an interest rate to the balance of the account as follows: For individual accounts: 1% APR for checking accounts 2% APR for investment accounts 5% APR for saving accounts o For business accounts: 0.5% APR for checking accounts 1% APR for investment accounts 2% APR for saving accounts Wire: The method should mimic wiring money to another account. The accounts can be owned by the same entity or by different entities. The method will need the source account and the target account. o The method will need the amount to be wired. The method will deduct the amount from the source (after checking the validity of the amount) and add it to the target. Implement the following method for the entity account: Change address: changes the address of the entity Implement the following methods for the wallet struct Display Accounts: Iterate and display the information on each account in the wallet. o The method should display the accounts in the following order: The checking accounts first The investment accounts second The saving accounts last Balance: Iterate through all accounts and return the overall balance in all accounts Wire: This method will mimic a wire from a source account to a target account The source account must be in the wallet The target account can be in the wallet or external. If the account doesn't have enough balance, display an error message Main Function Create a main function that can: Create account, entity, and wallet types Showcase the different methods implemented, based on the user interaction with the accounts. . Challenge After you have the basic program working as expected, add the following updates: Create a nice banking terminal. The terminal will allow user to View accounts Interact with accounts (deposit, withdraw, etc.) View the wallet Interact with the wallet Identify at least one design change that will make the structs and our program more elegant and efficient. Design changes can include Adding new attributes Adding new structs Implement new methods Instead of an error message, the wire method should recommend another account in the wallet that has enough balance to perform the transfer. Can you change the Account and wallet struct, so we are able to compute the overall interest rate paid to all the accounts in the wallet? o You will need to store the interest amount somewhere each time you apply interest to a particular account. Use appropriate data structures and logic to implement itStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started