Tutorial 1 Questions
- Write a Perl script to iterate through a list of numeric values such as (-3,2.5,9,0.76,11). It will print the smallestnumber and the largest number. If there are less than two elements in the list, then an error message will be produced.
- Write a Perl script to calculate the day of a given date (assuming the same month). It will randomly generate a date in between 1-7 as the first Monday of the month (by rand function). a) If the user enters a date in between 1-28, then the script will print out the day. b) If the date is in between 29-31, the corresponding day will still be printed but with a warning such as "that date might not be valid in the current month". c) If the given number is larger than 31 or less than 1, then an error will be printed.