The pseudo code below does the following: Accepts data for and validates a dollar amount. For terms of 10 and 20 years, it then calculates and displays the ending balance and total interest earned based on an interest rate of 5%. Revise the “main” pseudo code to utilize methods as follows: 1. Create a “getAmount” method that’s passed zero parameters. The method should return a valid amount where a valid amount must be between 100 and 10000 (inclusive). 2. Create a “showResults” method that’s passed two parameters which are the term and the amount. The method determines then displays the ending balance and total interest earned. 3. In the “main” logic, replace the existing code with appropriate calls to the methods. MAIN LOGIC: start input amt while amt < 100="" or="" amt=""> 10000 output “Bad amount” input amt endwhile deposit = amt rate = .05 term = 10 balance = deposit for yr = 1 to term interest = balance * rate balance = balance + interest endfor output “Balance after”, term, “years is”, balance output “Interest earned is”, interest term = 20 balance = deposit for yr = 1 to term interest = balance * rate balance = balance + interest endfor output “Balance after”, term, “years is”, balance output “Interest earned is”, interest stop Revised pseudocode for "main", “getAmount”, and “showResults”:
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here