Question: UNIX/PUTTY!!! Using the c shell /bin/csh write the utility called myCalc that satisfies the following specifications: Usage: myCalc operand1 operator operand2 myCalc is a very
UNIX/PUTTY!!!
Using the c shell /bin/csh write the utility called myCalc that satisfies the following specifications:
Usage: myCalc operand1 operator operand2
myCalc is a very simple calculator. operand1 and operand2 are integers. operator is the words plus, minus, div, and times. The operands and operators will be passed on the command line. Generate error messages if the operands are not valid or the operator is not valid. If no arguments are passed show the usage statement.
Example of what the command line will look like:
>myCalc 2 plus 3
>The answer is 5
Hint: In my cis204 directory there is a script that checks for a numeric number. (The following down below is the context from the script that checks for a numeric number).
#!/bin/csh -f
if ( $1 =~ *[^0-9]* ) then
echo "Not Numeric"
else
echo "Numeric"
endif
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
