From 24d18f5eb84c736b19768680ee1f768a58f5ad92 Mon Sep 17 00:00:00 2001 From: kaushal0701 <114973411+kaushal0701@users.noreply.github.com> Date: Tue, 4 Oct 2022 11:24:19 +0530 Subject: [PATCH 1/2] Create triangle.c --- 6th sem (Software Testing)/triangle.c | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 6th sem (Software Testing)/triangle.c diff --git a/6th sem (Software Testing)/triangle.c b/6th sem (Software Testing)/triangle.c new file mode 100644 index 0000000..e2d61b3 --- /dev/null +++ b/6th sem (Software Testing)/triangle.c @@ -0,0 +1,50 @@ +#include +#include +int main() { +inta,b,c; +printf("Enter the sides of the triangle: +\n"); +scanf("%d%d%d",&a,&b,&c); +if((a<1 || a>10)&&(b<1 || b>10)&&(c<1 || c>10)) +printf("Sides a,b and c are of out of range"); +else if((a<1 || a>10)&&(b<1 || b>10)) +printf("Sides a and b are out of range"); +else if((b<1 || b>10)&&(c<1 || c>10)) +printf("Sides b and c are out of range"); +else if((a<1 || a>10)&&(c<1 || c>10)) +printf("Sides a and c are out of range"); +else if(a<1 || a>10) +printf("side a is out of range."); +else if(b<1 || b>10) +printf("side b is out of range."); +else if(c<1 || c>10) +printf("side c is out of range."); +else + +{ +if((a Date: Tue, 4 Oct 2022 11:27:18 +0530 Subject: [PATCH 2/2] Create comission.c --- 6th sem (Software Testing)/comission.c | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 6th sem (Software Testing)/comission.c diff --git a/6th sem (Software Testing)/comission.c b/6th sem (Software Testing)/comission.c new file mode 100644 index 0000000..a05985e --- /dev/null +++ b/6th sem (Software Testing)/comission.c @@ -0,0 +1,50 @@ +#include +int main() +{ +intlocks,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; +}