You are on page 1of 1

CACANANTA, MARIA LOUISE VICTORIA M.

2022107113

Modify the program in Exercise 2b so that the main program also prompts the user for the interest rate
and passes both the amount of money and the interest rate to the interest-calculating method.

start

Declarations

num amount

num interestRate

input amount, interestRate

computeBalance(amount, interestRate)

output "New Balance: ", newBalance

stop

computeBalance(amount, interestRate)

Declarations

num amountInterest

num newBalance

amountInterest = amount * (interestRate/100)

newBalance = amount + amountInterest

output "Amount: ", amount, "Interest Rate: ", interestRate

return

You might also like