E Data File 987 E 236 ! 824 1 419 E 013 E 238 1 101 1 879 E 444 R 654 1 786 1 5.50 95.00 15.75 275.95 129.43 12.31 100.1
Posted: Sun May 15, 2022 12:17 pm
E Data File 987 E 236 ! 824 1 419 E 013 E 238 1 101 1 879 E 444 R 654 1 786 1 5.50 95.00 15.75 275.95 129.43 12.31 100.10 52.45 9.90 23.45 -34.56 Output In the output module, output the contents of each array and the total of all values in that array, clearly labeled and formatted for readability to a file ("HCOut.txt"). The output module must be a reusable module, calling it once with InArray and once with ExArray. Note Adequately check entered data for validity. Use adequate test data to process all valid data and representative data to verify that your program handles invalid data appropriately. Label all output clearly. You may NOT use return or break or exit to prematurely exit the program. Exit may only be used to check for correctly opened files - nowhere else in any program. Break may only be used in switch statements - nowhere else in any program. No pointers. You may NEVER use goto or continue statements in any program.
Write a complete modular program with 3 functions (input, calculate, output) to calculate the total amount of expenses and total amount of income for H.C. Advertising. All data will be input from a file (see below). 1) In the input module, Input data and error check data. Store Income (1) amounts in InArray and Expense (E) amounts in ExArray. If any data record contains an error, output the data to an error file with a message indicating what caused the error. Do not store error data in any array. 2) In the calculate module accumulate the total amount of values for that given array. Call the calculate module once with InArray and once with ExArray. 3) In the output module, output the contents of each array and the total amount of that array to an output file. Call the output module once with InArray and once with ExArray. Input Input data from a file ("HCIn.txt"). Create the data file below using your text editor or Notepad. One record of data contains the following sequence of data: 987 236 824 E 1 1 5.50 95.00 15.75 Where 987 E 1 5.50 Account number Expense Income Expense or income amount
Write a complete modular program with 3 functions (input, calculate, output) to calculate the total amount of expenses and total amount of income for H.C. Advertising. All data will be input from a file (see below). 1) In the input module, Input data and error check data. Store Income (1) amounts in InArray and Expense (E) amounts in ExArray. If any data record contains an error, output the data to an error file with a message indicating what caused the error. Do not store error data in any array. 2) In the calculate module accumulate the total amount of values for that given array. Call the calculate module once with InArray and once with ExArray. 3) In the output module, output the contents of each array and the total amount of that array to an output file. Call the output module once with InArray and once with ExArray. Input Input data from a file ("HCIn.txt"). Create the data file below using your text editor or Notepad. One record of data contains the following sequence of data: 987 236 824 E 1 1 5.50 95.00 15.75 Where 987 E 1 5.50 Account number Expense Income Expense or income amount