I'm taking a C class at the local community college,but missed four classes due to surgery.I've been trying to catch up and a tutor won't be available until late next week.I have a lab assignment due Tuesday and I'm stuck.
I have to create a program that calculates taxes owed depending on your tax bracket.I've managed to create a menu that will switch you to your tax bracket but don't understand how to get the user input to calculate.I don't know how to start.Please help!!The first tax bracket which is "single" uses the following calculation 0.15 * 17,850 + 0.28*(20000 - 17850)
Below is the code I have written so far.If somone can give me some guidance it would be appreciated.
Code:
#include<stdio.h>
char get_choice(void);
int main(void)
{
char ch ='e';
while ( (ch < 'a' || ch > 'd') && ch != 'q')
{
printf("By entering your filing status from the menu below and then your annual income\n");
printf("when prompted,this program will calculate your taxes owed.\n\n\n\n");
printf("Enter the letter of your choice:\n\n");
printf("a. Single\n");
printf("b. Head of Household\n");
printf("c. Married filing Jointly\n");
printf("d. Married filing Seperately\n");
printf("q. Exit Program\n");
printf("Please respond with a, b, c, d or q.\n\n");
ch = getchar();
switch(ch)
{
case 'a' : printf("Please enter your taxable income: \n");
break;
case 'b' : printf("Please enter your taxable income: \n");
break;
case 'c' : printf("Please enter your taxable income: \n");
break;
case 'd' : printf("Please enter your taxable income: \n");
break;
default : printf("Invalid entry\n\n");
break;
}
}
return 0;
}