Update Project_3.c
+- Modified Spacing, made sure lines don't go above 80 characters, and formatting is better.
This commit is contained in:
parent
d331ebfeaa
commit
5e7fb8d089
1 changed files with 42 additions and 17 deletions
|
|
@ -60,32 +60,57 @@ int main()
|
||||||
contributionToIRA = promptForInteger("Your IRA Contributions $: ");
|
contributionToIRA = promptForInteger("Your IRA Contributions $: ");
|
||||||
|
|
||||||
// conduct computations
|
// conduct computations
|
||||||
// totalIncome is user input
|
|
||||||
// IRA Contributions are subtracted from totalIncome to get a modified income (adjusted).
|
// IRA Contributions are subtracted from totalIncome
|
||||||
|
// to get a modified income (adjusted).
|
||||||
adjustedIncome = totalIncome - contributionToIRA;
|
adjustedIncome = totalIncome - contributionToIRA;
|
||||||
// Calculate the minimum Federal Tax that would have to be paid, using MIN_FED_TAX * PERCENTAGE_CONVERSION * adjustedIncome
|
|
||||||
|
// Calculate the minimum Federal Tax that would have to be paid,
|
||||||
|
// using MIN_FED_TAX * PERCENTAGE_CONVERSION * adjustedIncome
|
||||||
minTaxFederal = MIN_FED_TAX * PERCENTAGE_CONVERSION * adjustedIncome;
|
minTaxFederal = MIN_FED_TAX * PERCENTAGE_CONVERSION * adjustedIncome;
|
||||||
// Calculate the maximum Federal Tax that would have to be paid, using MAX_FED_TAX * PERCENTAGE_CONVERSION * adjustedIncome
|
|
||||||
|
// Calculate the maximum Federal Tax that would have to be paid,
|
||||||
|
// using MAX_FED_TAX * PERCENTAGE_CONVERSION * adjustedIncome
|
||||||
maxTaxFederal = MAX_FED_TAX * PERCENTAGE_CONVERSION * adjustedIncome;
|
maxTaxFederal = MAX_FED_TAX * PERCENTAGE_CONVERSION * adjustedIncome;
|
||||||
// Calculate the minimum AZ State Tax that would have to be paid, using MIN_AZ_TAX * PERCENTAGE_CONVERSION * adjustedIncome
|
|
||||||
|
// Calculate the minimum AZ State Tax that would have to be paid,
|
||||||
|
// using MIN_AZ_TAX * PERCENTAGE_CONVERSION * adjustedIncome
|
||||||
minTaxArizona = MIN_AZ_TAX * PERCENTAGE_CONVERSION * adjustedIncome;
|
minTaxArizona = MIN_AZ_TAX * PERCENTAGE_CONVERSION * adjustedIncome;
|
||||||
// Calculate the maximum AZ State Tax that would have to be paid, using MAX_AZ_TAX * PERCENTAGE_CONVERSION * adjustedIncome
|
|
||||||
|
// Calculate the maximum AZ State Tax that would have to be paid,
|
||||||
|
// using MAX_AZ_TAX * PERCENTAGE_CONVERSION * adjustedIncome
|
||||||
maxTaxArizona = MAX_AZ_TAX * PERCENTAGE_CONVERSION * adjustedIncome;
|
maxTaxArizona = MAX_AZ_TAX * PERCENTAGE_CONVERSION * adjustedIncome;
|
||||||
// Calculate the Social Security Tax that would have to be paid, using TAX_SSN * PERCENTAGE_CONVERSION * adjustedIncome
|
|
||||||
|
// Calculate the Social Security Tax that would have to be paid,
|
||||||
|
// using TAX_SSN * PERCENTAGE_CONVERSION * adjustedIncome
|
||||||
taxSSN = TAX_SSN * PERCENTAGE_CONVERSION * adjustedIncome;
|
taxSSN = TAX_SSN * PERCENTAGE_CONVERSION * adjustedIncome;
|
||||||
// Calculate the Medicare Tax that would have to be paid, using TAX_MC * PERCENTAGE_CONVERSION * adjustedIncome
|
|
||||||
|
// Calculate the Medicare Tax that would have to be paid,
|
||||||
|
// using TAX_MC * PERCENTAGE_CONVERSION * adjustedIncome
|
||||||
taxMC = TAX_MC * PERCENTAGE_CONVERSION * adjustedIncome;
|
taxMC = TAX_MC * PERCENTAGE_CONVERSION * adjustedIncome;
|
||||||
// Calculate the minimum amount of tax that would have to be paid, using minTaxFederal + minTaxArizona + taxSSN + taxMC
|
|
||||||
|
// Calculate the minimum amount of tax that would have to be paid,
|
||||||
|
// using minTaxFederal + minTaxArizona + taxSSN + taxMC
|
||||||
minTaxTotal = minTaxFederal + minTaxArizona + taxSSN + taxMC;
|
minTaxTotal = minTaxFederal + minTaxArizona + taxSSN + taxMC;
|
||||||
// Calculate the maximum amount of tax that would have to be paid, using maxTaxFederal + maxTaxArizona + taxSSN + taxMC
|
|
||||||
|
// Calculate the maximum amount of tax that would have to be paid,
|
||||||
|
// using maxTaxFederal + maxTaxArizona + taxSSN + taxMC
|
||||||
maxTaxTotal = maxTaxFederal + maxTaxArizona + taxSSN + taxMC;
|
maxTaxTotal = maxTaxFederal + maxTaxArizona + taxSSN + taxMC;
|
||||||
// Calculate the maximum income after tax has been paid, using totalIncome - minTaxTotal
|
|
||||||
|
// Calculate the maximum income after tax has been paid,
|
||||||
|
// using totalIncome - minTaxTotal
|
||||||
maxIncome = totalIncome - minTaxTotal;
|
maxIncome = totalIncome - minTaxTotal;
|
||||||
// Calculate the minimum income after tax has been paid, using totalIncome - maxTaxTotal
|
|
||||||
|
// Calculate the minimum income after tax has been paid,
|
||||||
|
// using totalIncome - maxTaxTotal
|
||||||
minIncome = totalIncome - maxTaxTotal;
|
minIncome = totalIncome - maxTaxTotal;
|
||||||
// Calculate the minimum tax rate, using minTaxTotal / totalIncome / PERCENTAGE_CONVERSION
|
|
||||||
|
// Calculate the minimum tax rate,
|
||||||
|
// using minTaxTotal / totalIncome / PERCENTAGE_CONVERSION
|
||||||
minEffectiveTax = (minTaxTotal / totalIncome) / PERCENTAGE_CONVERSION;
|
minEffectiveTax = (minTaxTotal / totalIncome) / PERCENTAGE_CONVERSION;
|
||||||
// Calculate the maximum tax rate, using maxTaxTotal / totalIncome / PERCENTAGE_CONVERSION
|
|
||||||
|
// Calculate the maximum tax rate,
|
||||||
|
// using maxTaxTotal / totalIncome / PERCENTAGE_CONVERSION
|
||||||
maxEffectiveTax = (maxTaxTotal / totalIncome) / PERCENTAGE_CONVERSION;
|
maxEffectiveTax = (maxTaxTotal / totalIncome) / PERCENTAGE_CONVERSION;
|
||||||
|
|
||||||
// display results
|
// display results
|
||||||
|
|
@ -137,7 +162,8 @@ int main()
|
||||||
printCharacter( PIPE );
|
printCharacter( PIPE );
|
||||||
printDoubleJustified( minEffectiveTax, PRECISION, VALUE_WIDTH -1, "RIGHT" );
|
printDoubleJustified( minEffectiveTax, PRECISION, VALUE_WIDTH -1, "RIGHT" );
|
||||||
printString( SPACE_PIPE );
|
printString( SPACE_PIPE );
|
||||||
printDoubleJustified( maxEffectiveTax, PRECISION, VALUE_WIDTH - 1, "RIGHT" );
|
printDoubleJustified( maxEffectiveTax, PRECISION,
|
||||||
|
VALUE_WIDTH - 1, "RIGHT" );
|
||||||
printString( SPACE_PIPE );
|
printString( SPACE_PIPE );
|
||||||
printEndline();
|
printEndline();
|
||||||
|
|
||||||
|
|
@ -187,4 +213,3 @@ int main()
|
||||||
|
|
||||||
// supporting functions
|
// supporting functions
|
||||||
// none
|
// none
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue