Need help converting my pseudocode to python, AND have a flowchart showing everything!The code:Main Module Call InputModuleEnd Main Module Module InputModule // This module gets input from the user Declare Principal, AnnualRate, Years as Float Output "Enter the Principal amount (P): " Input Principal Output "Enter the Annual Interest Rate (in percentage, e.g., 5 for 5%): " Input AnnualRate Output "Enter the number of Years to repay the loan: " Input Years Call DisplayPayment(Principal, AnnualRate, Years)End Module Module DisplayPayment(Principal, AnnualRate, Years) // This module calculates and displays the monthly payment Declare R, N as Float Declare MonthlyPayment as Float Declare PowerFactor as Float // second local variable // Calculate monthly interest rate R and number of months N Set R = (AnnualRate / 100) / 12 Set N = Years * 12 // Calculate PowerFactor = (1 + R)^N Set PowerFactor = (1 + R) ^ N // Calculate Monthly Payment using the given formula Set MonthlyPayment = [ (R * PowerFactor) / (PowerFactor - 1) ] * Principal Output "The monthly payment is: ", MonthlyPaymentEnd Module Pseudocode helped from:https://www.bartleby.com/s/b991d593-9508-4e20-96a1-42e67c7a1d61
Need help converting my pseudocode to python, AND have a flowchart showing everything!
The code:
Main Module
Call InputModule
End Main Module
Module InputModule
// This module gets input from the user
Declare Principal, AnnualRate, Years as Float
Output "Enter the Principal amount (P): "
Input Principal
Output "Enter the Annual Interest Rate (in percentage, e.g., 5 for 5%): "
Input AnnualRate
Output "Enter the number of Years to repay the loan: "
Input Years
Call DisplayPayment(Principal, AnnualRate, Years)
End Module
Module DisplayPayment(Principal, AnnualRate, Years)
// This module calculates and displays the monthly payment
Declare R, N as Float
Declare MonthlyPayment as Float
Declare PowerFactor as Float // second local variable
// Calculate monthly interest rate R and number of months N
Set R = (AnnualRate / 100) / 12
Set N = Years * 12
// Calculate PowerFactor = (1 + R)^N
Set PowerFactor = (1 + R) ^ N
// Calculate Monthly Payment using the given formula
Set MonthlyPayment = [ (R * PowerFactor) / (PowerFactor - 1) ] * Principal
Output "The monthly payment is: ", MonthlyPayment
End Module
Pseudocode helped from:
https://www.bartleby.com/s/b991d593-9508-4e20-96a1-42e67c7a1d61

Step by step
Solved in 2 steps with 1 images








