computer programming

posted by .

Problem 7. Design an algorithm that will produce a savings account balance report from a customer savings account file. Each input savings account record contains the account number, balance forward, deposits (sum of all deposits) , withdrawals (sum of all withdrawals), and interest earned. Your program is to read the savings account file and print a detail line for each savings account record showing account number, balance forward, deposits, withdrawals, interest earned and final account balance. The final account balance is calculated as balance forward + deposits – withdrawals + interest. A heading is to appear at the top of each page and allowance is to be made for 45 detail lines per page. At the end of the report, print the total balances forward, total deposits, total withdrawals, total interest earned and total final account balances. 7C. Solution algorithm
MAINLINE
Process_savings_account_record
Perform_initial_processing
Get final_account_balance
Set line count,total deposits, total withdrawals, total interest earned, to zero
Set
DOWHILE NOT EOF
Calculate_final_account_balance
Print detail_line
Print savings_account_report
Get final_account_balance
ENDDO
Print 'Final account balance = ', final_account_balance
Print 'Total balances forward = ‘, total_balance_forward
Print ‘Total deposits = ‘, total_deposits
Print ‘Total withdrawals = ‘, total_withdrawals
Print ‘Total interest earned = ‘, total_interest_earned
Print ‘Total final account balances =’, total_final_account_balances
END
end of the report, print the total balances forward, total deposits, total withdrawals, total interest earned and total final account balances.

Calculate_final_account_balance
Print_detail_line
Print end_of_report

Perform_initial_processing
Set page_count, line_count to zero
DOWHILE more savings_account_records
IF line_count > 45 THEN
ENDIF
MODULE
Calculate_final_account_balance
Print_detail_line (Account_num,Balance_forward, Sum_of_deposits, Sum_of_withdrawals, Final-_account_balance, line_count)
ENDDO
END
MODULE
Print blank line
Set line_count to zero
END

Calculate final_account_balance =
(balance_forward+deposits-withdrawals+interest)
Print_detail_line (Account_num,Balance_forward, Sum_of_deposits, Sum_of_withdrawals, Final-_account_balance, line_count)
Print end_of_report (Total_balances_forward, total_deposits, total_withdrawals, total_interest_earned, total_final_account_balances)
END

• computer programming -

It looks like a very good start for the pseudocode.

I would give the following comments:
1. include the definition of variables at the beginning of the pseudocode, as well as the type (int, double, etc.). If necessary, give a description.
2. You have included a lot of details of reading and printing, that is good.
3. Give the exact operations you plan to do with the variables, example,
- for a deposit, add the amount to the account balance.
- for a withdrawal, verify if the withdrawal exceeds the balance. If exceeded, print a message to that effect and cancel the withdrawal.
If the amount is not exceeded, proceed with the withdrawal (i.e. deduct the withdrawal amount from the account balance).
These checks should be done BEFORE each transaction is processed.

Also, it will help reading if you make a distinction between comments
"Read savings_account_record" is a comment, and
"Get final_account_balance "
is a computer executable statement.
You can put REM before comments (as in VB) or // (as in Java).

Similar Questions

1. math need help with this

If on the first of January a savings account has a balance of \$3200 what amount will be in this account after three years if the bank gives 6% per year interest compounded quarterly?
2. geometry

A person deposits \$500.00 into a savings account and pays 5% annual interest that is compounded yearly. At the end of the 10 years how much money will be in the savings account ?
3. Math

Mr. Malone is putting money in two savings accounts. Account A started with \$200 and Account B started with \$300. Mr. Malone deposits \$15 in Account A and \$10 in Account B each moth. In how many months will the accounts have the same …
4. Algebra

Mr. Malone is putting money in two savings accounts. Account A started with \$200 and Account B started with \$300. Mr. Malone deposits \$15 in Account A and \$10 in Account B each moth. In how many months will the accounts have the same …
5. I NEED HELP :(

Mr. Malone is putting money in two savings accounts. Account A started with \$200 and Account B started with \$300. Mr. Malone deposits \$15 in Account A and \$10 in Account B each month. In how many months will the accounts have the same …
6. math

a person deposits five hundred dollars in a savings account that pays 5% annual interest that is compounded yearly. At the end of ten years, how much money will be in the savings account?
7. Math

Mona opened a savings account with a \$500 deposit and a simple interest rate of 5.6%. If there were no deposits or withdrawals, how much money is in the account after 8/1/2  years
8. math

Malinda has a savings account set up so that her monthly interest -0.1% of the balance of her savings accounts is given to her as a check at the end of each month. If her savings account has a balance of \$1,500 all year. What will …
9. Math

The two-way table shows the number of fourth and fifth graders who do or do not have a savings account. What percent of fourth graders have a savings account?
10. Math HELP!

Jayden opens a savings account with \$100.00. His account pays 4% simple interest. How much money will be in his account one year later if he makes no deposits or withdrawals?

More Similar Questions