Question: 1 / / Compute Net Pay 2 totalWithholdings = 0 ; 3 4 for ( id = 0 ; id < numEmployees; id + +
Compute Net Pay
totalWithholdings ;
for id ; id numEmployees; id
compute social security withholding, if below the maximum
if memployee id governmentRetirementWithheld MAXGOVTRETIREMENT
governmentRetirement ComputeGovernmentRetirement memployee id ;
set default to no retirement contribution
companyRetirement ;
determine discretionary employee retirement contribution
if memployee id WantsRetirement &&
EligibleForRetirement memployee id
companyRetirement GetRetirement memployee id ;
grossPay ComputeGrossPay memployee id ;
determine IRA contribution
personalRetirement ;
if EligibleForPersonalRetirement memployee id
personalRetirement PersonalRetirementContribution memployee id
companyRetirement, grossPay ;
make weekly paycheck
withholding ComputeWithholding memployee id ;
netPay grossPay withholding companyRetirement governmentRetirement
personalRetirement;
PayEmployee memployee id netPay ;
add this employee's paycheck to total for accounting
totalWithholdings totalWithholdings withholding;
totalGovernmentRetirement totalGovernmentRetirement governmentRetirement;
totalRetirement totalRetirement companyRetirement;
SavePayRecords totalWithholdings, totalGovernmentRetirement, totalRetirement ;
Come up with flow graph, and compute cyclomatic complexity. Then come up with minimum number of test cases.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
