/* tax homework*/
#include <stdio.h>
main()
{
float income, net, totalco, avgp, totp, tax;
int count, ans, id;
printf ("Press 1 to run taxpayer anaylsis or any other key to stop program");
scanf ("%d", &ans);
while (ans == 1)
{
printf ("Taxpayer Id?");
scanf ("%d", &id);
printf ("Taxpayer's income?");
scanf ("%f", &income);
if ((income >= 0) && (income < 2390))
{
tax = 0;
net = income - tax;
}
else
if((income >= 2390) && (income < 3540))
{
tax = 11/100 (income - 2390);
net = income - tax;
}
else
if((income >= 3540) && (income < 4580))
{
tax = 126.50 + 12/100 (income - 3540);
net = income - tax;
}
else
if((income >= 4580) && (income < 6760))
{
tax = 251.30 + 14/100 (income - 4580);
net = income - tax;
}
else
if((income >= 6760) && (income < 8850))
{
tax = 556.50 + 15/100 (income - 6760);
net = - tax;
}
else
if((income >= 8850) && (income < 11240))
{
tax = 870.00 + 16/100 (income - 8850);
net = income - tax;
}
else
if((income >= 11240) && (income < 13430))
{
tax = 1252.40 + 18/100 (income - 11240);
net = income - tax;
}
else
if((income >= 13430) && (income < 15610))
{
tax = 1646.60 + 20/100 (income - 13430);
net = income - tax;
}
totalco = tax + totalco;
avgp = net/count;
totp = tax + totp;
printf ( "Id%d\t", id);
printf ( "# of employees%d\t", count);
printf ( "Income%f\t", income);
printf ( "Tax%f\t", tax);
printf ( "Net Income%f\t", net);
printf ("Press 1 to run taxpayer anaylsis or any other key to to stop program");
scanf ("%d", ans);
}
When ran thourgh the compiler I get an error that "100 can not be used as a function". In this program I'm trying to calculate the taxpayers' income, tax, net income and such. I tried 12% and .12. Would scientfic notation work?
#include <stdio.h>
main()
{
float income, net, totalco, avgp, totp, tax;
int count, ans, id;
printf ("Press 1 to run taxpayer anaylsis or any other key to stop program");
scanf ("%d", &ans);
while (ans == 1)
{
printf ("Taxpayer Id?");
scanf ("%d", &id);
printf ("Taxpayer's income?");
scanf ("%f", &income);
if ((income >= 0) && (income < 2390))
{
tax = 0;
net = income - tax;
}
else
if((income >= 2390) && (income < 3540))
{
tax = 11/100 (income - 2390);
net = income - tax;
}
else
if((income >= 3540) && (income < 4580))
{
tax = 126.50 + 12/100 (income - 3540);
net = income - tax;
}
else
if((income >= 4580) && (income < 6760))
{
tax = 251.30 + 14/100 (income - 4580);
net = income - tax;
}
else
if((income >= 6760) && (income < 8850))
{
tax = 556.50 + 15/100 (income - 6760);
net = - tax;
}
else
if((income >= 8850) && (income < 11240))
{
tax = 870.00 + 16/100 (income - 8850);
net = income - tax;
}
else
if((income >= 11240) && (income < 13430))
{
tax = 1252.40 + 18/100 (income - 11240);
net = income - tax;
}
else
if((income >= 13430) && (income < 15610))
{
tax = 1646.60 + 20/100 (income - 13430);
net = income - tax;
}
totalco = tax + totalco;
avgp = net/count;
totp = tax + totp;
printf ( "Id%d\t", id);
printf ( "# of employees%d\t", count);
printf ( "Income%f\t", income);
printf ( "Tax%f\t", tax);
printf ( "Net Income%f\t", net);
printf ("Press 1 to run taxpayer anaylsis or any other key to to stop program");
scanf ("%d", ans);
}
When ran thourgh the compiler I get an error that "100 can not be used as a function". In this program I'm trying to calculate the taxpayers' income, tax, net income and such. I tried 12% and .12. Would scientfic notation work?