Skip to content

Commit 131ed6a

Browse files
committed
Initial Draft
1 parent 19f234c commit 131ed6a

2 files changed

Lines changed: 91 additions & 75 deletions

File tree

README.md

Lines changed: 34 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -17,75 +17,60 @@ functions and describe their differences
1717

1818
## Introduction
1919

20-
Carefully explain what the student will do in the challenge.
20+
Today you'll build a mortgage rate calculator that runs in the console. As you learned today, JavaScript is great for adding functionality and interactivity to a webpage. In our exercises today we won't be working with the visual part of the webpage, but the work you do here could be combined with HTML and CSS to create a fully functioning single page application that was.
2121

22-
Explain the "why" behind the challenge. Homework for the sake of homework isn't motivating.
22+
The formula for a monthly mortgage payment is as follows:
2323

24-
The module challenge should be the most practical application of the lesson content. It should represent the task or set of tasks that would best prepare the student for an analogous (and likely) real-world scenario.
24+
```
25+
M = P [ I ( 1 + I )^N ] / [ ( 1 + I )^N – 1 ]
26+
```
2527

26-
As you provide a clear overview of the module challenge, make certain that the student (not just you) comprehends the relevance of this challenge in helping them realize their own goals of professional development. **It's vital** they understand how this is applicable in the workplace.
28+
In order to find your monthly payment amount "M,” you need to plug in the following three numbers from your loan:
2729

28-
## Completion requirements
30+
`P` = Principal amount (the total amount borrowed)
31+
`I` = Interest rate on the mortgage
32+
`N` = Number of periods (monthly mortgage payments)
2933

30-
Here you'll describe the features and tasks that the student will need to complete in order to finish the module challenge.
34+
Exercises are outlined in the `index.js` file and walk you through a series of steps for building a robust and functional mortgage calculator.
3135

32-
Provide all necessary detail in either paragraph form,
33-
34-
1. using
35-
2. a
36-
3. numbered
37-
4. list,
38-
- [ ] or
39-
- [ ] with
40-
- [ ] a
41-
- [ ] checklist.
42-
43-
Whatever manner most effectively communicates the information (consider whether a specific sequence is required or if illustrating a clear visual hierarchy would be beneficial).
44-
45-
## Stretch goals
46-
47-
Describe the tasks and features that would demonstrate a student's exceptional mastery of these principles — going above and beyond — but that exceeds what is required by the minimum expectations of the module challenge.
48-
49-
You can do this with full paragraphs or by using a checklist.
50-
51-
- [ ] or
52-
- [ ] by
53-
- [ ] using
54-
- [ ] a
55-
- [ ] checklist
36+
Check out the resources below for more a step by step walkthrough of this math, and to see a nicely designed mortgage calculator web app. Believe it or not, the backend you write today could power a beautiful site like that!
5637

5738
## Instructions
5839

59-
You may wish to include an ordered list of step-by-steps instructions to guide the student
40+
### Task 1: Set up Project
41+
42+
Using VSCode and Command Line:
6043

61-
1. through
62-
2. a
63-
3. sequential
64-
4. process.
44+
1. Fork repo and add TL as collaborator on Github.
45+
2. Clone your fork (not Lambda's repo by mistake!).
46+
3. `cd` into your newly cloned repository.
47+
4. Create a new branch by typing `git checkout -b <firstName-lastName>`.
6548

66-
## Tests
49+
### Task 2: Complete MVP Requirements
6750

68-
If you're including tests, describe how to run the tests and any setup required. Be as detailed as possible – testing is an area many of our students struggle with.
51+
Find the `index.js` file and complete the tasks as written. Your final product should be a function called `variableInterestRate` that accepts a `principal`, `interest rate`, `mortgage length`, and `credit score` and returns 10 different options of monthly payments.
6952

70-
> Test 1
53+
### Task 3: Stretch Goals
7154

72-
- Instructions
55+
After you have completed the requirements, try any of the following challenges. As always, note that these may require additional research beyond what you learned in this module.
7356

74-
## Testing
57+
- [ ] Add `Property Tax`, `Homeowner's insurance` and `HOA fees` as parameters in your function to calculate total monthly spend on housing
58+
- [ ] Build a third calculator that accepts `monthly payment` and `interest rate` and returns the maximum loan that a person could afford
59+
- [ ] Explore using `window.prompt()` to allow a user to input parameters in the browser
60+
- [ ] Refactor your `variableInterestRate()` function to accept an array of interest rates (make sure to copy and paste as to not lose your work!)
7561

7662
## Submission format
7763

78-
Describe how the student should deliver the completed challenge. If it's step-by-step,
64+
Follow these steps for completing your project.
7965

80-
1. include
81-
2. a
82-
3. numbered
83-
4. list.
66+
- [ ] Submit a Pull-Request to merge `<firstName-lastName>` branch into master. **Please don't merge your own pull request**
67+
- [ ] Add your TL as a reviewer on the pull-request
68+
- [ ] Your TL will count the project as complete by merging the branch back into master.
8469

85-
## Grading rubric
70+
## Resources
8671

87-
If you've prepared a grading rubric that will be used to evaluate the quality of a student's work on your module challenge assignment, include any instructions or relevant links below.
72+
🧮 [Detailed Walk-through of Mortgage Calculations](https://www.valuepenguin.com/mortgages/mortgage-payments-calculator)
8873

89-
[Grading rubric](example)
74+
👀 [Mortgage Calculator Web App for Inspiration](https://www.bankrate.com/calculators/mortgages/mortgage-calculator.aspx)
9075

91-
[Module challenge grading rubric](https://www.notion.so/e7b32e56ebad4f57b3521efb886f4508)
76+
🤟 [window.prompt for Stretch Goals](https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt)

index.js

Lines changed: 57 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,79 @@
1-
// Task 1:
2-
/* Write a function called "variables"
1+
// Task 1: Variables
2+
/* Create variables for principal, interest rate, and years. Assign them the values 200000, 0.05, and 30 respectively. Create another value called name and give it the value of your own name.
3+
*/
4+
5+
6+
7+
8+
9+
// Task 1.5: Simple Math
10+
/* To create a monthly mortgage rate calculator, we need to know the number of years in months and the monthly interest rate.
11+
12+
Create a variable called `monthlyInterestRate` and give it the value of interest rate divided by 12.
13+
14+
Create another variable called `periods` and give it the value of years*12.
15+
*/
16+
17+
18+
319

20+
// Task 2: Harder Math
21+
/* Create your calculator! Use the formula in the ReadMe to run calculations on your numbers. Save the final value into a variable called monthlyRate.
22+
23+
Hint: while these calculations can be done in one line, it might be helpful to create a variable called "numerator" to calculate the numerator, and another called "denominator" to calculate the denominator
24+
25+
Hint #2: you'll need to use the `math` object for parts of this calculation!
26+
27+
When your math is correct, monthlyRate will equal 1073.64
428
*/
529

6-
function declareVariables(){
7-
// code goes here
8-
}
930

10-
declareVariables();
1131

12-
// Task 2:
13-
/*
1432

33+
// Task 3: Function
34+
/* Create a function called `mortgageCalculator` that combines all of the steps from task 1 and 2 and returns a sentence "{Name}, your monthly rate is ${monthlyRate}"
35+
36+
If your name is `Oscar` mortgageCalculator() should return "Oscar, your monthly rate is 1073.64"
1537
*/
1638

17-
function math(){
18-
// code goes here
19-
}
2039

21-
math();
2240

23-
// Task 3:
24-
/*
2541

42+
43+
// Task 4: Arguments and Parameters
44+
/* Substitute the variables in your functions for parameters such that you can substitute `P`, `I`, and `N` when you call the function.
45+
46+
For example,
47+
mortgageCalculator(200000, 0.05, 30); <-- should return 1,073.64
2648
*/
2749

28-
function controlFlow(){
29-
// code goes here
30-
}
3150

32-
controlFlow();
3351

34-
// Task 4:
35-
/*
3652

53+
54+
// Task 5: Conditionals
55+
/* Add another paramter to your function called credit score. This parameter will be a number between 0 and 800 (a credit score).
56+
57+
Then, add control flow within your function such that IF creditScore is above 740, interest rate drops by 0.5%, if credit score is below 660, interest rate increases by 0.5% and if credit score is anywhere between 660 and 740 interest rate doesn't change.
3758
*/
3859

39-
function loops(){
40-
// code goes here
41-
}
4260

43-
loops();
4461

45-
// Task 5:
46-
/* Now its time to create your own function!
4762

63+
64+
// Task 6: Loops
65+
/* Write a new function called variableInterestRate. This function should be the same as mortgageCalculator, except it should return the monthly payment for 10 different interest rates at 0.5% increments plus or minus 2% from the inputted interest rate. Complete these calculations using a for loop.
66+
67+
For example, variableInterestRate(20000, 0.04, 30) should return:
68+
69+
"{Name}, with an interest rate of 0.02, your monthly rate is $739"
70+
"{Name}, with an interest rate of 0.025, your monthly rate is $790"
71+
"{Name}, with an interest rate of 0.03, your monthly rate is $843"
72+
"{Name}, with an interest rate of 0.035, your monthly rate is $898"
73+
"{Name}, with an interest rate of 0.04, your monthly rate is $955"
74+
"{Name}, with an interest rate of 0.045, your monthly rate is $1013"
75+
"{Name}, with an interest rate of 0.05, your monthly rate is $1074"
76+
"{Name}, with an interest rate of 0.055, your monthly rate is $1136"
77+
"{Name}, with an interest rate of 0.06, your monthly rate is $1199"
4878
*/
79+

0 commit comments

Comments
 (0)