Looping Statements Part 3: Constructing Hollow Square

Objectives

  • Create a form with an input box that will allow the user to enter a number (integer) with a button to process the script and a button to clear the form
  • Code a script that will read the number typed by the user that should be between 2 and 10
  • Based on that number, you will display a hollow square with that size constructed of asterisks
  • A separated div or paragraph element below the form where you will present the result
  • If the user entered an invalid number you should present an error message
  • If the user entered a valid number you should present the hollow square below the form

Results

Hollow Square Generator

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