code:
Code:#include <stdio.h> #include <math.h> /**********************************************************************************************************/ Sales Tax /**********************************************************************************************************/ /* Developed by: Glenn Wiggins */ /* */ /**********************************************************************************************************/ /* This program will compute a 6% sale tax on a purchase. The program user is to input the total amount of the */ /* purchase. The program is to return the original amount of the purchase, the tax, and the total of the two. */ /**********************************************************************************************************/ /* Variables used: */ /*------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* Purchase_amount = Total amount of purchase */ /* Sale_tax = Total amount of sale tax */ /* Total_sum = Total amount of purchase and total amount of sale tax added together */ /**********************************************************************************************************/ /* Constants used: */ /*------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* I = .06 (Sale tax percentage) */ /**********************************************************************************************************/ int main(void ) { /* Declarations block */ float Purchase_amount; /* Amount purchased. */ float Sale_tax; /*Amount of sales tax. */ float Total_sum; /*Total amount owed. */ float I = .06; /* Precent sale tax. */ /* Explain the program to the user. */ puts () ; puts (This program will compute a 6% sales tax on a purchase.) ; puts (It will return the original amount of the purchase, the tax, ) ; puts (and the total of the two.) ; puts () ; puts (You on ly need to enter the total amount purchased.) ; /* Get total amount purchase from user. */ puts () ; printf (Enter the total amount purchase => ) ; scanf ( %f, & purchase_amount) ; /* Do computations. */ Sale_tax = I * Purchase_amount ;
Code tags added by kermi3