SOLUTION FILE AVAILABLE AT: http://libraay.com/downloads/legal-clinic-monthly-report-algorithm/
Problem:
Design an algorithm to prepare a monthly report for a legal clinic. Input consists of a series of records that contain the name of the client, name of the attorney, and hours worked by the attorney on the case. Output is a monthly legal clinic report tat lists the client’s name, attorney, hours worked by the attorney on the case, and fee. The fee charged by the attorney is based on the hours worked. The first 20 hours are charged at the rate of $350.00 per hour. Hours in excess of 20 are charged at the rate of $200.00 per hour. After all records have been processed, the final totals are to be output. Include the total clients, total hours billed, total hours billed at $350.00 per hour, total hours billed at $200.00 per hour, and total fees. End-of-file will be indicated when the hours worked input is 0.
Solution:
Begin
Integer count, hrs_worked, fees, total_clients, total_hrs, total_350hrs, total_200hrs, total_fees
String attorney_name, client_name
total_hrs = 0
total_350hrs = 0
total_200hrs = 0
total_fees = 0
total_clients = 0
Print “Attorney Name”, “–“, “Client Name”, ”–“ , ”Hours Worked”, ”–“ , ”Fees”
Do
Prompt “Enter the attorney’s name: “
Input attorney_name
Prompt “Enter the client’s name: “
Input client_name
Prompt “Enter the number of hours worked by the attorney: “
Input hrs_worked
total_clients = total_clients + 1
If (hrs_worked <= 20)
fees = 350 * hrs_worked
total_350hrs = total_350hrs + hrs_worked
Else
Fees = (350 * 20) + (200 * (hrs_worked-20))
total_350hrs = total_350hrs + 20
total_200hrs = total_200hrs + (hrs_worked-20)
End If
total_hrs = total_hrs + hrs_worked
total_fees = total_fees + fees
Print attorney_name, “—“, client_name, “—“, hrs_worked, “—“, fees
While hrs_worked <> 0
Print “=============================================================”
Print “Total Clients: “, total_clients
Print “Total hours billed: “, total_hrs
Print “Total hours billed at $350.00 per hour: “, total_350hrs
Print “Total hours billed at $200.00 per hour: “, total_200hrs
Print “Total fees: “, total_fees
SOLUTION FILE AVAILABLE AT: http://libraay.com/downloads/legal-clinic-monthly-report-algorithm/