Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Instructions Develop a Swift function named Payment to calculate the amount of a mortgage payment. Use concepts learned in Module 2 . Requirements Refer to
Instructions
Develop a Swift function named "Payment" to calculate the amount of a mortgage payment. Use concepts learned in Module
Requirements
Refer to the appropriate video or any online source for how the mathematics of the calculation works. Your function should take as inputs:
The amount of the loan in whole dollars an Int
The number of payments eg for yearan Int
The interest rate per payment period in percent a positive floatingpoint number
The function should return the correct value in dollars and cents, a Float of the periodic payment of principal and interest ignore escrow accounts, taxes, and insurance for the following scenarios:
month loan of $ APR, compounded monthly
year loan of $ APR, one annual payment each year for years
Note that the interest rate you pass to the function is per payment period. If the period is one year and the interest rate is quoted as an annual rate such as an APR, then you just pass the APR. But, if you have an annual interest rate and the period is monthly, you would divide the rate by before passing it to the function.
There are many loan calculators online you can use to check your work.
Deliverables
A playground with the function defined as above.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started