Due Date: Monday Februay 8 by the end of the lab session
Submit the program you write with the Canvas link on the assignment.
Educational goals of this lab - verify that every student can
INSTRUCTIONS:
(10 points) Team Problem #1: Get to know your team
Description of the problem:
You are taking out a loan (principal) of a given amount, at a certain annual interest rate. You are going to be making monthly payments for a given number of years. Calculate what the payment will be, assuming it stays the same for each payment (called a "fixed payment").
(30 points) Team Problem #2: Test Cases (work these out FIRST!, before class if possible)
Create a multi-line comment at the bottom of your program file which contains the answers that go in the blanks below. It should be the expected output from the program described below, the payment, given the inputs in the case. Use a calculator as needed. Here is a online calculator that you can use. You get 15 points for calculating them, 15 points when your program runs and gives the correct answers.
For answer E, give the reason it is an error (you won't have numeric answers for it). Look at the formula, it is dividing by zero. Actually substitute the input into the denominator and show how that is zero. You do NOT NOT want to give the Python error here! You are doing these BEFORE the program is written!
Description | Inputs Principal Number of Years Interest Rate per Year (APR) | Expected Output Payment |
---|---|---|
Normal cases | ||
Normal case with positive floats for principal and interest rate | 220., 3, 20.5 | ____A.____ |
Normal case with positive ints for all inputs | 15000, 4, 10 | ____B.____ |
Boundary cases | ||
Very large number for principal normal numbers for rate and years | 1e9, 5, 10 | ____C.____ |
All inputs are 1 | 1, 1, 1 | ____D.____ |
Error case | ||
All inputs are 0 | 0, 0, 0 | ____E.____ |
Remember these answers, A-E, are in a multi-line comment at the bottom of the team .py file.
(15 points) Team Problem #3: Design
Paste this design into your .py file and complete the last 2 steps.
#1. Print title #2. Get inputs from user (principal, number years, interest rate) #3. Convert rate to percent and to monthly rate #4. Convert years to months #5. what? (5 points) #6. what? (5 points)
(40 points) Team Problem #4: Implementation
Payment Calculator Enter initial amount of loan: 25000 Number of years to pay back loan: 30 Interest rate per year (%): 3.25 Payment is $108.80
For this test case, the principal is 25000, the number of months is 30 * 12 (to make months from years), the interest rate is 3.25 divided by 100 (for percent) and then divided by 12 (for months).
Payment Calculator Enter initial amount of loan: 200000 Number of years to pay back loan: 15 Interest rate per year (%): 6 Payment is $1687.71
Make sure you save your programs somewhere as a backup to the copy on Canvas! Teams forget to submit sometimes!