Skip to content

Consolidation request #2

@PsySecCorp

Description

@PsySecCorp

https://github.com/piccolo794/Tutorials/blob/03b7c7160da03fa5294597ef26ee532a1bb1508c/Week%202%20-%2020150322/20150322-5-Assign2%20NOTED.c#L76

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions