Question
program that determines the fees for a Lawyer. Lawyers who work on contingency are paid by percent based on the amount of the settlement when
program that determines the fees for a Lawyer. Lawyers who work on contingency are paid by percent based on the amount of the settlement when they win the case according to the following table:
SettlementPercent
0 - 150,0005%
150,001 - 400,000 10%
400,001 - 600,00015%
600,001 - 10,000,00020%
Write the program so that it asks the user how many lawyers need to be processed and uses the number of lawyers to control the end of the program. For each lawyer, you will need to input the lawyer ID and amount of settlement. Use a while loop to validate the settlement to make sure that it falls between 0 and 10,000,000 dollars. Display the following message for an invalid settlement length: Invalid settlement. Please enter a number that is between 0 and 10,000,000 dollars. Display the lawyer ID, settlement, %, and fee for each lawyer processed within the loop. The fee is calculated by multiplying the settlement by the percent (and depending on how you write the program, you may need to divide the percent by 100) to get the correct fee. Use a printf command to display the output in 2 columns and make sure that the percents are formatted with 1 decimal place and the settlement and fee are formatted with 2 decimal places.
When the program ends, a message of Be careful. Pay lawyers. Enjoy life! should be displayed. To help you test your program, below is should run with 4 test cases and no invalid settlements. Remember that your program must process data correctly for any lawyer ID and any amount of settlement and not just those shown in the test cases:
Be sure to include comments at the top of your program to indicate your name and the name of the program and date.
Please enter the number of lawyers you want to process.
4
Please enter the lawyer ID (123456, 234567, 999999 etc.) for lawyer 1
123456
Please enter the Settlement:
150000
Lawyer ID123456
Settlement150000.00
%2.0
Fee3000.00
Please enter the Lawyer ID (123456, 234567, 999999 etc.) for lawyer 2
789101
Please enter the Settlement:
400000
Lawyer ID789101
Settlement400000.00
%4.0
Fee16000.00
Please enter the Lawyer ID (123456, 234567, 999999 etc.) for lawyer 3
987654
Please enter the Settlement:
600000
Lawyer ID987654
Settlement600000.00
%6.0
Fee36000.00
Please enter the Lawyer ID (123456, 234567, 999999 etc.) for lawyer 4
654321
Please enter the Settlement:
10000000
Lawyer ID654321
Settlement10000000.00
%10.0
Fee1000000.00
Be careful. Pay lawyers. Enjoy life!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started