Ask questions and get helpful responses.

programming

create the logic for a program that calculates and displays the amount of money you would have if you invested $5000 at 2 percent simple interest for one year. create a separate method to do the calculation and return the result to be displayed.

  1. 👍
  2. 👎
  3. 👁
  4. ℹ️
  5. 🚩
  1. start
    Declarations
    num balance
    balance = computeBalance()
    output "After one year the balance is", balance
    stop
    balance = computeBalance()
    num computeBalance()
    Declarations
    num balance
    num PRINCIPAL = 5000
    num INTEREST_RATE = 0.02
    balance = PRINCIPAL * (1 + INTEREST_RATE)
    return balance

    1. 👍
    2. 👎
    3. ℹ️
    4. 🚩

Respond to this Question

First Name

Your Response

Still need help? You can ask a new question.