forked from wijaksanapanji/learn-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Oluwaseyi.html
24 lines (23 loc) · 828 Bytes
/
Oluwaseyi.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cost Calculator</title>
<script>
let annualCost = 35000;
let inflationRate = 5;
let yearsAttendance = 4;
let yearsUntilCollege = 5;
let collegeCost = annualCost;
let inflation = 0;
for (i = 0; i < yearsAttendance-1; i++){
inflation = 0.05 * collegeCost;
collegeCost = collegeCost + inflation;
};
console.log(`Annual College costs: $${annualCost}, College Cost Inflation rate: ${inflationRate}% \nand expected years of attendance is ${yearsAttendance}. You have to pay $${collegeCost}`);
annualSavings = collegeCost/yearsUntilCollege;
console.log(`Annual Savings should be: $${annualSavings}`);
</script>
<body>
</body>
</html>