Question
Please upload a single PERL .pl file on eLearning: 1. Write code to do the following using: a. Set the value of variable x to
Please upload a single PERL .pl file on eLearning:
1. Write code to do the following using: a. Set the value of variable x to 100. b. Print the value of 2x + 5.
2. Write a script that generates two random numbers between -10 and 10 and if the numbers match then prints Match Found else prints Different Numbers. You can use $RANDOM to generate the random numbers.
3. Write a script to declare two scalar variables x and y, initialize them to some values, and compute sum of their squares.
4. Write a script to declare two list(array) variables x and y of length 3 each, initialize them to using numbers, compute a list that is the sum of these lists, and print the middle three elements of the resulting list.
5. Write a script to declare a hash variable x which contains 3 values and 3 keys, initialize values to names and keys to numbers.
6. Write a script using ifelsifelse to compare three words entered by the user and compare if any two match.
7. Write a script using the while loop construct that generates 100 randomly generated numbers between 0 and 99 and writes them out in a user specified filename.
8. Write a subroutine to generate two random numbers between -10 and 10 and compute sum of their squares.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started