c code :
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
float
total_purchase,amount,discount,dis_amount=0,sales_tax=0;
char str[40];
printf("Enter total purchase Amount\n");
scanf("%f",&total_purchase);
/*confirming whether the customer is a teacher or not*/
printf("Whether the customer is a teacher(y or n)\n");
scanf("%s",&str);
if(strcmp(str,"y")==0){
if (total_purchase >= 100){
discount = 0.12 * total_purchase;}
else{
discount = 0.10 * total_purchase;}
/*calculate total discount amount for the customer*/
dis_amount = total_purchase - discount;
/*calculate sales tax for the music teacher*/
sales_tax = 0.05 * dis_amount;
/*calculate total amount*/
amount = dis_amount + sales_tax;}
/*Display receipt*/
if(strcmp(str,"y")==0){
printf("Total purchases :$%.2f\n",total_purchase);
printf("Teacher's discount(12%%) :%.2f\n",discount);
printf("Discounted total :%.2f\n",dis_amount);
printf("Sales tax(5%%) :%.2f\n",sales_tax);
printf("____________________________\n");
printf("Total :$%.2f\n",amount);}
else{
printf("Total purchases :$%.2f\n",total_purchase);
sales_tax = 0.05 * total_purchase;
printf("Sales tax(5%%) :%.2f\n", sales_tax);
printf("______________________________\n");
printf("Total is :%.2f\n",
total_purchase + sales_tax);}
getch();
return 0;
}
c code sample screenshot:
output screenshot
//comment if u need further help
//please upvote happy learning
amming Projects 1. Keith's Sheet Music needs a program to implement its music teacher's dis- count...
CASE 1-5 Financial Statement Ratio Computation Refer to Campbell Soup Company's financial Campbell Soup statements in Appendix A. Required: Compute the following ratios for Year 11. Liquidity ratios: Asset utilization ratios:* a. Current ratio n. Cash turnover b. Acid-test ratio 0. Accounts receivable turnover c. Days to sell inventory p. Inventory turnover d. Collection period 4. Working capital turnover Capital structure and solvency ratios: 1. Fixed assets turnover e. Total debt to total equity s. Total assets turnover f. Long-term...