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

README.md

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>
<html>
  <body>
    <script>
      // your code here
    </script>
  </body>
</html>
  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: https://codingwithbasir.com/how-to-deliver-projects/

Need help?

Download Learn JavaScript eBook from https://codingwithbasir.com/learn-javascript

You can’t perform that action at this time.