Lopping Statements Part 2: Compound Interest Tables

Objectives

  • Code a script to show 3 tables with the calculation of compound interest on a principal of $1000
  • The 3 tables should be: one for 5%, another for 6% and another for 7%
  • Each of the tables will show the rows from year 1 through 5
  • The formula to calculate the compound interest is: A = P(1 + r)n
  • The tables should alternate the background colors of the rows

Results

Learn about Compound Interest

Compound Interest Table for 5%

Year Amount Interest Rate

Compound Interest Table for 6%

Year Amount Interest Rate

Compound Interest Table for 7%

Year Amount Interest Rate

Part 1


Create a webpage that will contain a script using the for looping statement and another script using the while loop that calculate the product and sum of a set of integers and then displays the results, along with some accompanying text.

View Part 1

Part 2


You will create a web page to show to interested clients how the compound interest works. You will code a script to show 3 tables with the calculation of compound interest on a principal of $1000.

View Part 2

Part 3


Create a webpage with a form with an input box that will allow the user to enter a number. Based on that number, you will display a hollow square with that size constructed of asterisks.

View Part 3