-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
These lines can be consolidated and thus, keep your line count more eyeball-friendly.
commissionDollars = makeIntoDollars(floor((salesAmtCents * (12.5 / 100)) + 0.5));
bonusDollars = makeIntoDollars(floor(((years * (weeksProfitCents * (0.5 / 100))) + 5000) +0.5));
grossSalDollars = makeIntoDollars(commissionCents + bonusCents);
retirementDollars = makeIntoDollars(floor((grossSalCents * (8.0 / 100)) + 0.5));
stateTaxDollars = makeIntoDollars(floor((grossSalCents * (10.0 / 100)) + 0.5));
fedTaxDollars = makeIntoDollars(floor((grossSalCents * (25.0 / 100)) + 0.5));
totalDedDollars = makeIntoDollars(retirementCents + stateTaxCents + fedTaxCents);
netSalaryDollars = makeIntoDollars(grossSalCents - totalDedCents);This will also reduce the amount of ints you have to define at the beginning by half.
Also, when invoking a function, don't put a space between the function name and the parenthesis:
:(
someFunc (1, 2, 3);:)
someFunc(1, 2, 3);Metadata
Metadata
Assignees
Labels
No labels