-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActivity3Switch.c
70 lines (59 loc) · 1.83 KB
/
Activity3Switch.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <stdio.h>
int main() {
int salesmanNo, section, noOfItems;
float pricePerItem, sales, commission;
char salesmanName[30], sectionCode;
printf("\n\tABC Department Store\n\t Makati City");
printf("\n\nSalesman No: ");
scanf("%d", &salesmanNo);
printf("Salesman Name: ");
scanf("%s", salesmanName);
printf("Section Code: ");
scanf(" %c", §ionCode);
switch (sectionCode) {
case 'A':
case 'a':
printf("Section: Ladies Section");
break;
case 'B':
case 'b':
printf("Section: Men's Section");
break;
case 'C':
case 'c':
printf("Section: Infant's Section");
break;
case 'D':
case 'd':
printf("Section: Children's Section");
break;
case 'E':
case 'e':
printf("Section: Shoe's Section");
break;
case 'F':
case 'f':
printf("Section: KitchenWare Section");
break;
case 'G':
case 'g':
printf("Section: Appliance's Section");
break;
default:
printf("Unidentified Section");
}
printf("\nNo. of items: ");
scanf("%d", &noOfItems);
printf("Price per items: ");
scanf("%f", &pricePerItem);
sales = noOfItems * pricePerItem;
printf("Sales: %.2f\n", sales);
if (sales > 25000) commission = sales * 0.05;
else if (sales >= 20001 && sales <= 25000) commission = sales * 0.04;
else if (sales >= 15001 && sales <= 20000) commission = sales * 0.03;
else if (sales >= 10001 && sales <= 15000) commission = sales * 0.02;
else commission = sales * 0.01;
printf("Commission: %.2f\n", commission);
printf("\nProgrammer's Name: CUENZA, RICKY S.\n\n");
return 0;
}