CNIT 133 Homework 4 - Looping Statements

CNIT 133 Main Page

function

Part1: First part of homework4 uses a javascript for loop to calculate (5 * 9 * 13 * 17 * 21) and (5 + 9 + 13 + 17 + 21). It uses a javascript while loop to calculate (3 * 6 * 9 * 12 * 15 * 18 * 21) and (3 + 6 + 9 + 12 + 15 + 18 + 21). It also features a jQuery based draggable loop schematic.

Part2: Second part of homework4 calculates the compound interest on a principal of $1000 for interest rates of 5, 6, and 7%, for years 1 through 10. The formula to use is : A = P(1 + r)^n where A = Accumulated amount, P = Principal amount, r = fractional interest, n = number of years. Nested for loops were implemented for this task.

Extra Credit: Extra credit part of homework4 requires us to input the size of the side of a square and display a hollow square of that size constructed of asterisks. Nested for loops and preformatted html tags were implemented for this task. jQuery was used to focus cursor on the input field.