PROGRAM ASSIGNMENT #3

Dr. Harris
DUE: 1:00 pm, Friday, February 23, 2001
VALUE: 60 pts.

The law firm of Biddle, Riddle and Twit, S.C has a number of experienced lawyers, all of whom are qualified to carry out work on any of five different types of legal service. Since law firms bill their clients for the number of hours a project requires, each lawyer keeps a detailed time sheet listing the starting and ending time for the work they do on each project Your program will read the time sheet of a single lawyer covering a typical day, generating a printed output of the work performed and fees charged by that lawyer for the day.

Each time a lawyer in the office begins a job, he marks his time sheet with the client's name and the beginning time. Likewise when he finishes the job, he marks his sheet with the ending time for that job. He also indicates on the sheet by numeric code what kind of service was being performed. Thus a time sheet will contain several lines of the following format: the lawyer's name will appear in the first 15 columns of every line, the client's name will appear in the next 15 columns of the line, followed by a numeric code 1 - 5 indicating the type of service performed, followed by the beginning time and ending time for that service in military format. For example, a typical line on the time sheet could be:

John Smith     Bill Clinton    2  1400  1530
indicating that lawyer John Smith performed service type number 2 for client Bill Clinton beginning at 1400 hours (2:00pm) and ending at 1530 hours (3:30pm), or an elapsed time of 1.5 hours for that service. The time sheet for the lawyer you are processing will be contained in the text file OFFICE.DAT. I will put this file on the class web site no earlier than February 16th. Until then you should test your program using your own test data file(s). Do not wait until I release the data to begin work on this project!

Biddle, Riddle and Twit has had their fee plan in place for many years. The hourly fees rates for each kind of service vary with the difficulty and/or skill level required to perform that service. The services and their hourly fees rates are (these are the actual rates of fees charged to the client for each service):

   Service Code  Service Description     Hourly Rate
        1          Wills                    50.00          
        2          Divorce                  75.00
        3          Bankruptcy              100.00
        4          Trust Mgt.               60.00
        5          Civil Suit              150.00

Lawyers also charge back to the firm daily time-and-a-half for overtime for all work over 8 hours based on their average hourly rate for the day. For example, if John Smith worked 9 hours on a given day, charging $540.00 for all 9 hours worked (without regard to overtime), his average hourly rate would be $60.00 ($540.00 / 9), and so he would be charge back to the firm one hour of overtime fees, or an extra charge of $30.00 for the day.

Input for this program will come from the file OFFICE.DAT but all output from the program will be sent to the user's screen. As an example of typical processing and output, let us assume that OFFICE.DAT contains the following lines:

John Smith     Thos Jefferson      4  0700  1200
John Smith     Geo Washington      0  1200  1300
John Smith     Abraham Lincoln     1  1300  1430
John Smith     John F. Kennedy     5  1500  1730

The output of your program would appear as follows:

                            BIDDLE, RIDDLE AND TWIT, S.C.
================================================================================
   Lawyer            Client      Start   End Service        Service      Service
    Name              Name        Time  Time  Hours       Description        Fee
================================================================================
John Smith       Thos Jefferson    700  1200   5.00       Trust Mgt.      300.00
John Smith       Geo Washington   1200  1300   1.00       Invalid Code      0.00
John Smith       Abraham Lincoln  1300  1430   1.50       Wills            75.00
John Smith       John F. Kennedy  1500  1730   2.50       Civil Suit      375.00
================================================================================
SUBTOTALS:                                     9.00                       750.00
================================================================================
OVERTIME:                                      1.00 hrs @ 83.33 per hr     41.67
================================================================================
TOTAL FEES:                                                               791.67
================================================================================
Program #3, Spring 2001
Programmed by ???, Section #?
Due: February 23, 2001    Value = 60 pts

All of the information above is to appear in your program's output in very much the same format as you see it. Notice that the lawyer's name is printed on each line, along with the client's name, the start and end times for each service from the time sheet, the elapsed time for each service as calculated by the computer, the name of the service as determined by the table above, the fees for the service as determined by the number of hours spent on the service multiplied by the hourly rate (see above table). The total number of hours for the lawyer is given in the subtotal line along with the day's fees. The overtime fee is calculated, showing on that line the number of overtime hours worked and the average fee rate for the day. The total of all fees in shown at the bottom of the display. Fill in the required information in the ??? at the bottom of the output. You may assume that the office operates only between the hours of 0600 and 2100.

Use the following structures in this program:

A question of style:

  1. Your Constant section will be very extensive in this program. It must contain constants for each of the service descriptions and service fees rates, among others. It also contains the "magic constants" 8 and 0.5 which are used to determine overtime fees.
  2. Declare explicit storage locations for all quantities printed in the output display. For example, you must have storage locations for the total hours worked, the number of overtime hours, the fee for each service, the elapsed time for each separate service, etc.

Turn in:

  1. A program listing, properly signed on each page.
  2. A hot print of your user screen when your program is run against the data file OFFICE.DAT provided for you on the web. Also sign each of this output.
  3. A virus-free diskette containing your program code file named PRG3_S01.PAS and the file OFFICE.DAT.

Advice for developing this program:

  1. Design an easy input data file using the Turbo Editor. Have only 2-3 lines in it with easy numbers which you can use to check the values generated by your program.
  2. Start with a bare-bones program which does nothing more than set up the file I/O structures (file name, Text storage location, Assign statement, etc.) Do nothing more in the main loop of the program than read each line of the file and echo print the data read from the line to the screen. Your program will therefore do no processing at this stage of development.
  3. Add the logic which will compute the elapsed time for each service as a decimal number of hours. Thoroughly check your logic that it is producing correct results.
  4. Add the CASE structure which will determine the proper service description and service fee rate. Calculate the fee charged for each service. Thoroughly test your logic that correct answers are being generated.
  5. Calculate the overtime fee. Add the necessary logic to calculate all subtotals. Thoroughly check that results are correct.
  6. Pretty up the output.

You have two weeks to do the program, and it can be easily done in six days. Expect the total amount of effort to be 5 - 10 hours (much less if nothing goes wrong, of course). I would appreciate it if you would put on the front page of your program listing the estimated total time you spent on this program (if you keep track). Thanks.


Return to
CS-171
Home Page
    Return to
UW-W
Home Page
   
This page last updated
February 8 2001