Lab
-
First,
-
Write an HTML file that prompts a user for his/her age.
-
In the corresponding Perl script, do an if test to see if the user is 21
or older.
-
If the user is 21 or older, print "<br>Here's a Hudy Delight.
You deserve it."
-
If the user is 20 or younger, print "<br>Go have a happy meal and leave
me alone!";
-
After you have tested that,
-
Add a loop to the else part of the if test above. Print "<br>Go
have a happy meal and leave me alone!" three times.
-
Try your favorite loop. If you have more time, try others.
-
Can you think of a way to do step 2 without using
a loop, and without typing the line more than once?
Hashes
Home