Answered step by step
Verified Expert Solution
Link Copied!

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 2.
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 (e.g.360 for 30-year)(an Int)
The interest rate per payment period in percent (a positive floating-point 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:
2-month loan of $20,000,4.4% APR, compounded monthly
30-year loan of $150,000,5% APR, one annual payment each year for 30 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 12 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions