home page button
site layout button
control structures button
string functions button
user input button
midterm button
state information button

If/Else Statement | Switch Statement | While Loop | For Loop

The If/Else Statement

The If/Else Statement - use this statement to execute some code if a condition is true and another code if the condition is false.

The if else test the modulous return of the year against 12 options and uses and if elseif format to display each sign.

[Test the Script] | [View the Source Code]

The Switch Statement

The Switch Statement - use this statement to select one of many blocks of code to be executed.

The switch statment cases test the modulous return of the year against 12 options and uses and case format to display each sign.

[Test the Script] | [View the Source Code]

The While Loop

The While Loop - loops through a block of code while a specified condition is true.

Uses the modulous of the years to reset the row so that every year the signs repeate the table starts a new row.

[Test the Script] | [View the Source Code]

The For Loop

The For Loop - loops through a block of code a specified number of times.

Similar to the while but uses a different syntax for the loop structure, also uses the modulous of the years to reset the row so that every year the signs repeate the table starts a new row.

[Test the Script] | [View the Source Code]