In: Computer Science
A vacation rental property management company must file a monthly sales tax report listing the total sales for the month and the amount of state and city sales tax collected. The state sales tax rate is 6 percent and the local city sales tax rate is 9 percent. Write a program (using functions) that asks the user to enter the total sales for the month. From this figure, the application should calculate and display the following:
The amount of local city sales tax
The amount of state sales tax
The total sales tax (city plus state)
Please help
NOTE
#########
Programming language is not specified so the program is written in C
//########################## PGM START #################################
#include<stdio.h>
//function to find city tax
double cityTax(double sales){
return sales*0.09;
}
//function to find state tax
double stateTax(double sales){
return sales*0.06;
}
//main method
int main(){
double salesAmount=0;
printf("Enter the sales amount: ");
scanf("%lf",&salesAmount);
double cTax=cityTax(salesAmount);
double sTax=stateTax(salesAmount);
double totalTax=cTax+sTax;
//printing sales tax for city , state and total
tax
printf("The amount of local city sales tax:
%.2lf\n",cTax);
printf("The amount of state sales tax:
%.2lf\n",sTax);
printf("The total sales tax (city plus state):
%.2lf\n",totalTax);
return 0;
}
//######################### PGM END ####################################
OUTPUT
########
################################## PYTHON PROGRAM ############
def cityTax(sales):
return sales*0.09
def stateTax(sales):
return sales*0.06
if __name__=="__main__":
salesAmount=0
salesAmount=float(input("Enter the sales amount:
"))
cTax=cityTax(salesAmount)
sTax=stateTax(salesAmount)
totalTax=cTax+sTax
print("The amount of local city sales tax:
{}".format(cTax))
print("The amount of state sales tax:
{}".format(sTax))
print("The total sales tax (city plus state):
{}".format(totalTax))
############################## END PROGRAM####################################