The Internal Revenue Service allows tax payers who itemize deductions to write-o
ID: 3648534 • Letter: T
Question
The Internal Revenue Service allows tax payers who itemize deductions to write-o mileagedriven for various purposes. During the 2012 tax year, the following rates have been set:
55.5 cents per mile for business miles driven
23 cents per mile driven for medical or moving purposes
14 cents per mile driven in service of charitable organizations
Write a program to determine a user's total deduction for mileage driven. Your program will prompt
the user for the total mileage driven in 2012 for each category. It will add up the total deduction and
report it to the user. Note: the user should be able to enter fractional miles, however you should report
only whole cents (the IRS allows you to round up only if the fractional cent is greater than one half).
Explanation / Answer
#include int main(void) { float bMiles=0.0,mMiles=0.0, sMiles=0.0; //declare and initialize miles float bRate=55.5,mRate=23,sRate=14; float deduction; printf("Enter the miles driven for business in 2012:"); scanf("%f",&bMiles); printf("Enter the miles driven for medical or moving purposes in 2012:"); scanf("%f",&mMiles); printf("Enter the miles driven in service of charitable organizations in 2012:"); scanf("%f",&sMiles); deduction=((bMiles*bRate)+(mMiles*mRate)+(sMiles*sRate))/100.00; printf("Your total deduction is: $%0.2f",deduction); return 0; }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.