LAB 44: THE ifelse CONSTRUCT AND THE let COMMAND

 <  Day Day Up  >  

LAB 44: THE if/else CONSTRUCT AND THE let COMMAND

  1. Write a script called grades that will ask the user for his or her numeric grade on a test.

    1. The script will test that the grade is within the possible grade range, 0 to 100.

    2. The script will tell the user if he or she got an A, B, C, D, or F.

  2. Write a script called calc that will perform the functions of a simple calculator. The script will provide a simple menu:

     [a] Add [s] Subtract [m] Multiply [d] Divide [r] Remainder 

  3. The user will choose one of the letters from the menu.

  4. The user will then be asked to enter two integers between 0 and 100.

  5. If the numbers are out of the range, an error message will be printed and the script will exit.

  6. The program will perform the arithmetic on the two integers.

  7. The answer will be printed in base 10, 8, and 16.

 <  Day Day Up  >  


UNIX Shells by Example
UNIX Shells by Example (4th Edition)
ISBN: 013147572X
EAN: 2147483647
Year: 2004
Pages: 454
Authors: Ellie Quigley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net