Write a C program to manage 50 bank accounts. The accounts are identified by numbers ranging from 100 to 149 as integer values. For instance, Account number 100 corresponds to the data stored in index 0, and account number 111 corresponds to the data stored in index 11. Therefore, when a user provides an account number, your program should include a function that returns the index where that account is stored. The program can handle various transactions and will be implemented as a menu driven program. You will use an array to store information for the 50 accounts. Initially, this array of accounts will be initialized to -1, where -1 signifies that the account is not yet open. The following table presents the questions that the program will ask the user. Each response to a transaction-type question should be a single character. If the user provides an illegal character, the program should display an error message. All amounts are in dollars and can have up to 2 decimal places. Note: Use the interest formula below for your interest calculation balance += balance * interestRate / 100 Transaction type?: O or o Initial deposit?: amount Open an account, giving the initial deposit. Allowed if less than 50 accounts now open and Amount should be greater or equal to 100 dollar. Prints the new account number. Transaction type?: B or b Account number?: account_number A Balance inquiry, prints the account number and the balance, only allowed if the account is open. Transaction type?: D or d Account number?: account_number Amount?: amount A Deposit, prints the account number and new balance, only allowed if account open. Transaction type?: W or w Account number?: account_number Amount?: amount A Withdrawal, only allowed if account open and sufficient funds available, prints account number and new balance. Transaction type?: C or c Account number?: account_number Close the account. Only allowed if account is open. Transaction type?: I or i. Interest rate?: interest_rate Compute interest at given % rate.and apply to all accounts Transaction type?: P or p Print all the account numbers and amounts. Transaction type?: E or e Close all accounts and exit program
Write a C
Note: Use the interest formula below for your interest calculation balance += balance * interestRate / 100
Transaction type?: O or o Initial deposit?: amount Open an account, giving the initial deposit. Allowed if less than 50 accounts now open and Amount should be greater or equal to 100 dollar. Prints the new account number.
Transaction type?: B or b Account number?: account_number A Balance inquiry, prints the account number and the balance, only allowed if the account is open.
Transaction type?: D or d Account number?: account_number Amount?: amount A Deposit, prints the account number and new balance, only allowed if account open.
Transaction type?: W or w Account number?: account_number Amount?: amount A Withdrawal, only allowed if account open and sufficient funds available, prints account number and new balance.
Transaction type?: C or c Account number?: account_number Close the account. Only allowed if account is open.
Transaction type?: I or i. Interest rate?: interest_rate
Compute interest at given % rate.and apply to all accounts
Transaction type?: P or p Print all the account numbers and amounts.
Transaction type?: E or e Close all accounts and exit program
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images