diff --git a/index.html b/index.html index b458c1ff..85c6bc40 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,6 @@
-Open up the console to check your work!
diff --git a/index.js b/index.js index 667af155..697189c7 100644 --- a/index.js +++ b/index.js @@ -4,10 +4,6 @@ /* 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. */ - - - - // 🏡 Task 1.5: Simple Math /* To create a monthly mortgage rate calculator, we need to know the number of years in months and the monthly interest rate. @@ -16,8 +12,6 @@ */ - - // 🏡 Task 2: Harder Math /* Create your calculator! Use the formula in the ReadMe (also below) to run calculations on your numbers. Save the final value into a variable called monthlyRate. @@ -103,3 +97,32 @@ For example, variableInterestRate(200000, 0.04, 30) should console.log: /* 🏡 Refactor your `variableInterestRate()` function to accept an array of interest rates (make sure to copy and paste as to not lose your work!) */ + + function mortgageCalculator(principal, interestRate, years, creditScore){ + const name = "Ally"; + let monthlyInterestRate = ( interestRate / 12 ) + let periods = ( years * 12 ) + let i = monthlyRate + + let variableInterestRate = ( monthlyRate * 0.95 ) + for (let i = 0; i < 10; i + 0.95) { + console.log(name + ",with an interest rate of" + monthlyInterestRate + "your monthly rate is" + variableInterestRate + "