From 36f24c0048726ab46a9dd50718555f65e53a955f Mon Sep 17 00:00:00 2001 From: Shashank Kemmarana <90085526+shashankKemmarana@users.noreply.github.com> Date: Tue, 4 Oct 2022 11:45:08 +0530 Subject: [PATCH] Create st10.c --- 6th sem (Software Testing)/st10.c | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 6th sem (Software Testing)/st10.c diff --git a/6th sem (Software Testing)/st10.c b/6th sem (Software Testing)/st10.c new file mode 100644 index 0000000..55c042e --- /dev/null +++ b/6th sem (Software Testing)/st10.c @@ -0,0 +1,50 @@ +#include +int main() +{ +int locks,stocks,barrels,sales,flag=0; +float commission; +printf("Enter the total number of locks\n"); +scanf("%d",&locks); +printf("Enter the total number of stocks\n"); +scanf("%d",&stocks); +printf("Enter the total number of barrels\n"); +scanf("%d",&barrels); +if((locks<=0) || (locks>70)) +{ +flag=1; +printf("Locks Out of Range\n"); +} +if((stocks<=0) || (stocks>80)) +{ +flag=1; +printf("Stocks Out of Range\n"); +} +if((barrels<=0) || (barrels>90)) +{ +flag=1; +printf("Barrels Out of Range\n"); +} +if(flag == 1) +{ +printf("Invalid input\n"); +return 0; +} +sales= locks*45 + stocks*30 + barrels*25; +if(sales <= 1000) +{ +commission = 0.10 * sales; +} +else if(sales <= 1800) +{ +commission = 0.10 * 1000; +commission = commission + (0.15 * (sales - 1000)); +} +else +{ +commission = 0.10 * 1000; +commission = commission + (0.15 * 800); +commission = commission + (0.20 * (sales - 1800)); +} +printf("Total sales: %d and Commission: %f\n",sales,commission); +return 0; +}