Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Oluwaseyi.html chapters changed Oct 28, 2019

Project JavaScript B1 Variables

Topics: Create a Variable: let , Create a Variable: const , Mathematical Assignment Operators , The Increment and Decrement Operator , String Concatenation with Variables , String Interpolation , typeof operator , Review Variables

Project Title: College Cost Calculator

  1. Create a html file with your name like john.html
  2. Add current code to that file:
<!DOCTYPE html>
      // your code here
  1. For a 4 years college degree, define two variables:
  • Annual cost: $35000
  • Inflation rate: %5

All variables are number.

  1. Calculate the Total Cost for a 4 years college degree and log it into console like this:

For a 4 years college degree with annual cost: ${annualCost} and inflation rate: ${inflationRate}, you have to pay ${totalCost}.

  1. Imagine you have 5 years to save money for college. How much do you need to save annually to afford the college cost? Log the result into console like this:

You need to save ${annualSaving} annually for ${yearsUntilCollege} years.

Want to get reviewed?

Send Pull Request. Check how to deliver your code:

Need help?

Download Learn JavaScript eBook from

You can’t perform that action at this time.