CIS 2279 Homework Assignment #03

Due Mon Sep 12, 2016 (23:55)

Create a perl script named username-lab03.pl. The script must perform the following:

  1. Accepts two (2) command line arguments: The first should set the test for temperature or relative humidity. The second should be a numeric data value.
    The command would look something like this: lab03.pl RH 95
  2. Checks the number of arguments and exits the program if the required arguments are not provided.
  3. Checks that the second argument is numeric and prints an error message if it is not.
  4. If the first argument is for temperature, check that the value in the second argument is a reasonable value (ie. greater than -40F and less than 120F)
  5. If the first argument is for relative humidity, check that the value of the second argument is a reasonable value (0-100).
  6. Print to the screen a statement of whether the data value is within range.
  7. For the following path, /mnt/homes/CLASSES/CIS2279/LAB03/test.jpg test for and print to the screen the following properties:
    • Is test.jpg a file or directory?
    • Is test.jpg readable?
    • Is test.jpg writeable?
solution

last updated: 08 Sep 2016 17:28

Last modified: Mon Sep 7 09:22:18 EDT 2015