question archive Work for an banking analytics organization have been tasked with writing a program that simulates an analysis of transactions

Work for an banking analytics organization have been tasked with writing a program that simulates an analysis of transactions

Subject:Computer SciencePrice: Bought3

Work for an banking analytics organization have been tasked with writing a program that simulates an analysis of transactions. Code a modular program that uses parallel arrays to store bank transaction types (deposits or withdrawals) and transaction amounts (in USD). The program must do the following: The program must first ask the user for the number of bank accounts that will be in the simulation. This must be done by calling the getNumAccounts() function (definition below). After the input of the number of accounts, the program must use loops and random numbers to generate the account type and the transaction amount for each bank account in parallel arrays. These arrays must not be declared globally (major error). The following arrays must be declared and populated: transactionTypes[] - an array of type string to hold the transaction type for the account. The size of the array is determined by the number of bank accounts the user entered in step 1. The values in the array represent the type of transaction on the account ("deposit" or "withdrawal"). transactionAmounts[] - an array of type long to hold the amount of money from each transaction. The size of the array is determined by the number of bank accounts the user entered in step 1. The values in the array represent the amount of money that is deposited or withdrawn during the transaction. In this bank simulation, deposits and withdrawals have a minimum amount of $5.00 and a maximum amount of $10000. Populate both of these arrays by using a loop that will execute based on the number of bank accounts the user entered in step 1. On each pass, call the generateTransactionType() function (definition below) to generate a transaction type and store in the transactionTypes[] array and call the generateTransactionAmount() function (definition below) to generate a transaction amount and store in the transactionAmounts[] array. Once both of the arrays are populated, the program must display the result statistics of the simulation. This includes displaying the transaction types and the amount of money in each transaction along with counts, averages, and totals. This must be done by calling the displayStats() (defined below) function that accepts both of the arrays as well as the number of bank accounts the user entered in step 1. In addition to the main() function, declare prototypes, write function definitions and correctly call the following functions: getNumAccounts() - this is an integer-returning function that must allow the user to specify the number of bank accounts that will be evaluated in the simulation. This company can simulate between 5 and 100 accounts in the simulation. Validate the user input so that the user must enter between 5 and 100 bank accounts. If the user enters an invalid number of bank accounts, they must be given an unlimited amount of chances to enter a valid number of bank accounts. The function must return the validated number of bank accounts. generateTransactionType() - this is a string-returning function that generates a random transaction t ype for the account. Generate a random number between the value of 1 or 2 first. If a 1 is generated, the transaction is a "deposit", otherwise, the transaction is a "withdrawal". Return the string and store in the transactionTypes[] array in main(); generateTransactionAmount() - this is a long-returning function that generates a random transaction amount between $5 and $10000. Note: use the long data type to return the transaction amount and store in the transactionAmounts[] array in main(). displayStats() - Function must accept the parallel arrays that contain the transaction types, transaction amounts, as well as the number of accounts in the simulation and display the transaction number along with the transaction type and the transaction amount formatted with proper spacing on separate lines to match the sample output. Then calculate and display the following: The total number of transactions (count) The total number of deposits (count) The total number of withdrawals (count) The average amount per deposit The average amount per withdrawal The average amount per transaction The total amount deposited The total amount withdrawn The total amount transacted

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions