There will be COUNTERS and ACCUMULATORS of totals that will be very important in
ID: 3538574 • Letter: T
Question
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 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 program in pseudocode and using "while structure" ect.. I would greatly appreciate someone answering ASAP! thank you in advance!
Explanation / Answer
while (true)
{
1. enter the name of a client.
2. store the name of the client into a String type variable say patientName.
3. enter the name of the attorney.
4. store the name of the attorney into a String type variable say attorney.
5. enter hours by attorney on the case.
6. Print a statement that "Make sure you dont enter 0 . If you do the loop will terminate or the program will end. If you want to terminate, then please press 0."
7. store the number of hours into a double type variable say noOfHours
8. if input is 0, terminate the loop or the program
////////////////////////
(for your reference, in java it is done something like this in JAVA
if (input == 0)
{
System.exit(1);
}
)
//////////////////
9. declare an array of String type
/////////////
(for your reference, it is done like String[] names = new String[1000] in java assuming max number of patients ll be 1000. You can increase or decrease this number as per your need)
//////////////////
10. declare a variable counter of integer type
11. store the patientName using a for loop inside the array everytime it is entered by the user and increment the counter every time a patient is added. Counter ll give the total number of patients.
////////////////////////
(for your reference, this is the way you do it in java
for (int i = 0; i< names.length; i++)
{
names[i] = patientName;
counter++;
}
//////////////////////////////
this will store the names into one array of Strings)
12.declare a variable totalNoOfHours which ll be the sum of numberOfHours
//////////////////////
(this ll be done as totalNoOfHours+= numberofHours)
////////////////////
13. declare a variable rate of double type and initialize it to zero
14.declare a variable hoursLessThanTwenty and initialize it to zero
15. declare a variable hoursMoreThanTwenty and initialize it to zero
16. declare a variable totalFee and initialize it to zero
17. if (noOfHours <= 20)
{ hoursLessThanTwenty += noOfHours;
then rate = noOfHours * 150.00;
totalFee += rate;
}
else
{
hoursMoreThanTwenty+ =noOfHours-20;
rate = 20 * 150 +((noOfHours-20) * 100);
totalFee += rate;
}
18. print rate which ll calculate the cost for the patient and print it.
19. print counter which ll print the total number of clients
20. print totalNoOfHours which ll print the total number of hours billed.
21. print hoursLessThanTwenty which ll print the hours billed at $150.00
22. print hoursMoreThanTwenty which ll print the hours billed at $100.00
23. print totalFee which ll print the total fees
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.