First Assignment

Make a simple loan calculator. Your app will consist of a single view.

The calculator will compute the monthly payment for a loan given the loan amount, the term of the loan in years, and the annual percentage rate on the loan.

To compute the monthly payment use the formula

where rate is the APR divided by 1200 and n is the term in years times 12. To compute an exponent in Swift, use the pow() function:

ab = pow(a,b)

Helpful hint

Laying out the labels and text fields for this project is a bit of a pain. An easier way to organize the user interface is to use stack views. You can read about stack views in chapter 11. There is an example there where the authors use stack views to layout a set of text fields and labels.