There will be counters and accumulators of totals that will

There 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 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 that lists the client’s name, attorney, hours worked by the attorney on the case, and fee. The fee charged by the attorney is based upon the hours worked. The first 20 hours are charged at the rate of $150.00 per hour. Hours in excess of 20 are charged at the rate of $100.00 per hour. After all records have been processed, the final totals 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 hours, and total fees. End of file (or the loop will stop) when the hours worked input is 0. 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.

Solution

Note

Here we used “//” and “/*...*/” for commenting purpose.

Pseudocode

//while structure.
while (true)
{

   //Get the name of the client.
1.   Prompt the user to enter the name of a client.

//Save the name of the client in a variable.
2.   Store the user input (name of the client) in a String variable, say \" nameofClient\".

//Get the name of the attorney.
3.   Prompt the user to enter the name of the attorney.

//Save the name of the attorney in a variable.
4.   Store the user input (name of the attorney) in a String variable, say \" nameofAttorney\".

//Get the number of hours worked on the case by Attorney.
5.   Prompt the user to enter the number of hours worked.

//Warning message.
6.   Print an output statement like message \" Ensure that you haven’t entered 0!. If you have entered zero, the loop will terminate. If you want to end, then enter 0! \"

//Save the user input of number of hours worked in a variable.
7.   Save the number of hours attorney worked on the case in a variable type double, say \"numberOfhoursWorked\"

//Condition Check on the numberOfhoursWorked.
8.   If the numberOfhoursWorked == 0, then end the code.

//Otherwise.
9.   Otherwise proceed further.

//Declare a string array for client names
10.   Declare a string array for names.

/*In case you are coding in java. Here we declared the maximum number of clients as 1000. We can increase or decrease the number as per our requirements.*/
String[] clientnames = new String[1000];

   //Declare an integer variable for incrementation.
11.   Declare an integer variable say, \"increment\".

/*Everytime the user enters a client name. Save the \" nameofClient\" in the string array using a for() loop. Increment the \"increment\" every time a client is added.*/
12.   for(int i = 0; i < clientnames.length; i++)
{
   clientnames[i] = nameofClient;
   increment++;
}

//Declare a variable to save the total number of hours worked.
13.   Declare an integer variable say, \"totalNumberOfHoursWorked\" which will be the sum of \"numberOfhoursWorked\"

totalNumberOfHoursWorked += numberOfhoursWorked;

//Declare the necessary variables for computation.
14.   Declare a double variable \"rate\" and initialize it to 0.
15.   Declare an integer variable \"hoursWorkedLessThanTwenty\" and initialize it to 0.
16.   Declare an integer variable \"hoursWorkedMoreThanTwenty\" and initialize it to 0.
17.   Declare an integer variable \"feeTotal\" and initialize it to 0.

//Condition check and Computation.
18.    if(numberOfhoursWorked <= 20)
   {
       hoursWorkedLessThanTwenty +=    numberOfhoursWorked;
       rate = numberOfhoursWorked * 150.00;
       feeTotal += rate;
}
else
{
   hoursWorkedMoreThanTwenty += numberOfhoursWorked - 20;
   rate = 20 * 150 + ((numberOfhoursWorked - 20) * 100);
       feeTotal += rate;
}

//Display output.  
//Cost for the client.
19. Display the \"rate\".

//Total number of clients.
20. Display the \"increment\".

//Total number of hours billed.
21. Display the \"totalNumberOfHoursWorked\".

//Total fee.
22. Display the \"feeTotal\".
}

There 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 hou
There 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 hou

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site