Hello people of cprogramming.com
i need some help in writing a programming which is short should do the following:
program displays a menu that offers the user four options:
* enter a transaction
* view the general journal
* view the balance sheet
* quit the program
Balance Sheet
Account Description Debit Credit
------- ------------------------------ ---------- ----------
1400 1500.00
1000 899.01
1100 1000.00
1300 2100.99
---------- ----------
Total Assets 5500.00
2100 3500.00
---------- ----------
Total Liabilities 3500.00
3100 4000.00
3200 2000.00
---------- ----------
Total Equity 2000.00
---------- ----------
Total Liabilities and Equity 5500.00
There are 30 blank spaces reserved for each account description (to be added later).
Note the subtotals for the account types - assets, liabilities, and equity - and the sum of the liability and equity accounts.
[Hint: You may store the account balances in a separate array and adjust them whenever the user enters a transaction. Alternatively, you may calculate the account balances afresh every time the user displays the balance sheet.]
You may assume a maximum of 20 transactions and a maximum of 10 different accounts. These limits will allow you to display either the general journal or the balance sheet on a 24-line screen.
if i could get some help in going about in making the balance sheet it would be appreciated.
so far i have the done the coding for the transaction menu and the journal.
Basically i need to SORT the following arrays for the balance sheet
transaction_amount[m]
transaction_type[m]
transaction_account[m]
so lets say i have the following values for the arrays:
transaction_account[m]: 1400, 1200, 1000, 1400, 1200, 1000, 900, 900
transaction_type[m] : D , D , C , D , C , D , D , C
transaction_amount[m]: 200 , 500, -500 , 750 , -1000, 750, 800, -400
i would want them sorted as:
transaction_account[m]: 1400, 1200, 1000, 900
transaction_type[m] : D , C , D , D
transaction_amount[m]: 950 , -500, 250 , 400
however since im a beginner in arrays and c programming i have no clue on how to go about sorting them.