Related questions
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 stepSolved in 2 steps with 1 images
- Text book imageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrText book imageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningText book imageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Text book imageProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageText book imageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningText book imageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,