CIS 2279 Homework Assignment #02
Due Friday, September 11,
2009
All files created must be saved in your class directory
/mnt/homes/CLASSES/CIS2279/<username>
- Create a perl script named lab02.pl in your user directory. The
script must perform the following:
- Create an array listing seven of your favourite foods.
- Create an array listing five foods you dislike.
- Print out the last two items in your "favourite
foods" array and the first three items in your "disliked
foods". Include some descriptive text to clarify your output.
- For the "disliked foods" array, move the value of
the last element of the array to become the first
element of the array.
- Print out the first and last elements of each array to show
the changes from the previous step.
- Ask the user to add another food to list list of disliked foods
and then append this new item to the appropriate array.
- Print (to the terminal) the last element of the disliked
foods array you just appended to confirm the change.
last updated: 09 Sep 2009 14:25