here will be COUNTERS and ACCUMULATORS of totals that will be very important in
ID: 3538578 • Letter: H
Question
here will be COUNTERS and ACCUMULATORS of totals that will be very important in this problem. (total clients, total hours, total hours billed at 150, total hours billed at 100 and total fees)
Use a WHILE structure to design the pseudocode to prepare a monthly report for a legal clinic. Input consist of a series fo records that contain the name of the client, name of attorney, and hours by attorney on the case. Output is a monthly legal clinic report that list the clients name, attorney, hours worked by attorney on the case and fee. The fee charged by the attorney is based upon the hourse worked.. the first 20 hours are charged at the rate of $150.00 per hour. Hours in excess of 20 hours are charged at the rate of $100.00 per hour. After all records have been processed, the FINAL cost are to be PRINTED. Include the total clients, total hours billed, Total hours billed at $150.00 per hour, total hours billed at $100.00 per hour, and total fees. END OF FILE. (or the loop will stop) When the hours worked input is 0 (zero). Make sure that you include a statement to make sure that hours does not equal zero at the start of the process. It may be helpful to use modules in this program.
If someone could write out this in pseudocode and using "while structure" ect.. I would greatly appreciate someone answering ASAP! thank you in advance!
Explanation / Answer
Algorithm start
Declare an array of string type variable called name_client
Declare an array of string type variable called name_attorney
Declare a float variable total_cost
Declare a float variable total_fees
Declare a float variable total_hour_150
Declare a float variable total_hour_100
Declare a int variable hour
Declare a int variable total_hour
Declare a client_counter
Set client_counter to 0
Set total_cost to 0
Set total_fees to 0
Set total_hour to 0
Set total_hour_150 to 0
Set total_hour_100 to 0
do
Read in value name_client
Read in value name_attorney
Read in value hour
if total_hour is less than 20
increment client_counter by 1
total_cost = hour*150
total_hour_150=total_hour_150+hour
else
increment client_counter by 1
total_cost = (hour-20)*100+ 20*150
total_hour_150=total_hour_150+20
total_hour_100=total_hour_100+hour-20
end if
total_hour=total_hour+total_hour_150+total_hour_100
total_fees=total_fees+total_cost
print name_client
print name_attorney
print hour
print total_cost
while hour not equal to zero
end do-while
print client_counter
print total_hour
print total_hour_150
print total_hour_100
print total_fees
algorithm end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.