In the following program, the variables stand for:
ts- Total sales
ctax- County sales tax
stax- State sales tax
ttax- Total sales tax
#include<stdio.h>
double ts,ctax,stax,ttax;
void inputtotalsales()
{
printf("\nEnter total sales: ");
scanf("%lf",&ts);
}
void calculatetaxes()
{
ctax=0.02*ts;
stax=0.04*ts;
}
void displaytaxes()
{
printf("\nCounty Sales Tax: %.2lf",ctax);
printf("\nState Sales Tax: %.2lf",stax);
printf("\nTotal Sales Tax: %.2lf",ctax+stax);
}
int main()
{
inputtotalsales();
calculatetaxes();
displaytaxes();
return(0);
}
Get Answers For Free
Most questions answered within 1 hours.