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:
- 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
- Checks the number of arguments and exits the program if the
required arguments are not provided.
- Checks that the second argument is numeric and prints an error message if it is not.
- 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)
- If the first argument is for relative humidity, check that the
value of the second argument is a reasonable value (0-100).
- Print to the screen a statement of whether the data value is
within range.
- 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