US:1 As a site visitor, I want to calculate my monthly loan payment, so that I know if I can afford the
car I am interested in purchasing.
US:1 Notes:
Loan payment calculation requires:
Loan amount (A)
Number of periodic payments (n) = payments per year * number of years
Periodic interest rate (i) = annual rate / number of payment periods
Discount Factor calculation:
Discount Factor (D) = ((( 1 + i ) ^n ) – 1 ) / ( i ( 1+ i) ^n)
Assume $100,000 borrowed at 6% interest for 30 years, to be repaid monthly:
A = $100,000
n = 360 (30 years * 12 monthly payments)
i = .005 (.06 / 12 monthly payments)
D = 166.7916 (((1 + .005) ^360 ) – 1 ) / (.005 (1 + .005) ^360))
Loan payment (P) = A / D = $599.55 (in this case monthly payment)
https://www.thebalance.com/loan-payment-calculatio…
Suggested Workflow:
-
Create a new GitHub repository for this homework and initialize it. Clone down the repository
to your local computer. - Create a .gitignore file to omit files and directories from Git as suggested for Python and Flask.
- Create a Python virtual environment inside of the project folder and active the environment.
- Create app.py and add the basic Flask template.
- Start your Flask server and browse to your website. You should see “Hello world!”
-
Add basic Jinja template directories and files. Modify app.py to return render_template.
Restart your Flask server and test. - Create a “basic Flask server” commit.
- Create a feature branch and change into this new branch.
-
(INPUT) Modify base.html, index.html, and stylesheet.css based to create an HTML form based
on requirements from the user stories. - Test & commit with useful commit messages.
-
(PROCESS) Modify app.py to collect the data from your form into variables. Calculate the loan
payment amount based on the formula found in the user story notes. -
(OUTPUT) The calculation should produce a value stored in a variable that is displayed on
index.html after processing. - Test your application.
- Create a requirements.txt file for you project (pip freeze > requirements.txt)
- Merge the feature branch into the master branch.
- Push to GitHub.
-
Create a resource group, app service plan (Linux), and app service (Python) in your Microsoft
Azure account. -
In the app service Deployment configuration, connect your web app to your GitHub
repository for this project. - Visit the URL shown in your app service. You should see the web application running.
-
Test it. If there are issues, create a “debug” local feature branch and change into this branch.
Fix the issues and commit with useful messages. Merge the feature branch back into the local
master branch and push to GitHub. You should see the changes update on your Azure web
server.
Deliverables:
- The URL to your running web application
- The URL to your GitHub repository for this application


0 comments