117 Homework Assignment #4

03/20/06
Write a perl program to do the following:

   - ask the user for the height and base of a triangle
     Do not check if the input is reasonable,
     i.e. only use reasonable values in your testing.

   - calculate the area of the triangle
      using the formula

      area = .5 * height * base

   - display the result using this model:

A triangle of height 27.2 and width 4.3 has area: 58.48

   - I will deduct points if your output could be made
     closer to the model I provided.

   - Do not modify the area as perl calculates it.

To submit this program:
   If you develop your program under windows,
   save your program as prog4.pl
   make sure it runs correctly under windows.

   make sure your first line is
#!/usr/bin/perl

   ftp unix01.sac.edu
      login with your 3 char login and 5 char password

      mkdir homework.d    # create this dir only once!
      cd homework.d
      put prog4.pl
      chmod 755 prog4.pl  # ignore any error if not supported
      quit

   I will grade these programs once per week
      and will rename as prog4x.pl once it is graded.
   and post any deductions that you can see
   when you click "View homework"
   You may fix the program and resubmit.


Some deductions that I have given out: -1 incorrect program name -1 use longer, more descriptive variable names -1 missing or incorrect magic first line