Question: Create a perl script named lab11.pl. The script must perform the following: 1. Ask the user for their first name and store the value in

Create a perl script named lab11.pl. The script must perform the following: 1. Ask the user for their first name and store the value in a variable. 2. Ask the user for their last name and store the value in a variable. 3. Ask the user for their home town and store the value in a variable. 4. Ask the user for the current temperature and store the value in a variable. 5. Display the values in these variables back to the screen in a readable manner. 6. The script must be executable by simply running the file itself.

Part 2: Arrays Create a perl script named lab12. The script must perform the following: 1. Create an array listing six of your favorite foods. 2. Create an array listing six foods you dislike. 3. Print out the first three items in the favorite foods array. Include some descriptive text to clarify your output. 4. For the "disliked foods" array, move the value of the last element of the array to become the first element of the same array. 5. Print out the first and last elements of each array to show the changes from the previous step. 6. Ask the user to add another food to the disliked foods array and then append this new item to the appropriate array. 7. Print (to the terminal) the last two element of the food array you just appended to confirm the change.

Part 3: Program Arguments Create a perl script named lab13.pl . The script must perform the following: 1. Accepts the current temperature and RH (%) as commandline arguments. 2. Checks that the temperature is a sane value (for surface observations) for both high and low values. (Example: The temperature should be greater than -50F and less than 150F). Print an error message if the value is invalid. 3. Checks that the RH is a sane value (0-100) and prints an error if the value is out of range. 4. Print the temperature and RH% to the screen in a readable manner.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!