CIS 2279 Homework Assignment #02
Due Mon, Sep 5,
2016
- Create a perl script named username-lab02.pl. The script must
perform the following:
- Create a single array containing the names of four of your
favorite foods and a second array with four of your least liked foods.
- Add another element to the end of each array by asking the
user for another food the like/hate.
- Print out the last two items in the least liked
foods array. Include some descriptive text to clarify your
output.
- For the "favorite foods" array, move the value of
the first element of the array to become the last
element of the same array.
- Print out the first and last elements of both arrays to show
the changes from the previous step along with some descriptive text.
- Remove the last element of the favorite foods array and add it to
the beginning of the disliked foods array
- Print out the first and last elements of both arrays to show
the changes from the previous step along with some descriptive text.
- Remove the last element of the disliked foods array and
display it to the terminal with some descriptive text.
- Print to the terminal the number of elements in each
array with some text.
- Delete both arrays before exiting the program.
Solution
last updated: 01 Sep 2016 16:06