Looping Statements Part 1: For Looping Statement

Objectives

  • Create a looping statement that calculates the product and sum of every fourth integer from 5 to 25 inclusive
  • Create another script using the while looping statement that calculates the product and sum of every third integer from 3 to 18 inclusive
  • Display the results with accompanying text
  • Use toLocateString() to present results with the correct punctuation
  • Use jQuery UI to allow the user to drag an element to any area of the page

Results

Drag me around if you
think math is hard!

Sum and Product of Integers

Using For Loop: Every Fourth Integer from 5 to 25

Using While Loop: Every Third Integer from 3 to 18

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