Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- int main() {
- int fchoice, schoice, quantity, stotal, total = 0, x;
- do {
- printf("Do you want to purchase an item?\n Yes\t(1)\n No\t(2)");
- scanf("%d", &x);
- switch (x)
- {
- case 1:
- {
- printf("Select your order:\n1.Plywood\n2.Nails\n3.Metal Sheet\n");
- scanf("%d", &fchoice);
- switch (fchoice)
- {
- case 1:
- printf("Thickness:\n1. 1 inch\tPhp. 300.00\n2. 3/4 inch\t Php. 250.00\n3.1/2 inch\t Php. 200.00\n4. 1/4 inch\t Php. 150.00\n");
- scanf("%d", &schoice);
- switch (schoice)
- {
- case 1:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 300;
- break;
- case 2:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 250;
- break;
- case 3:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 200;
- break;
- case 4:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 150;
- break;
- default:
- printf("Option not found!");
- break;
- }
- break;
- case 2:
- printf("Per Kilo:\n1. 1.5 inch\tPhp. 60.00\n2. 2 inches\t Php. 70.00\n3. 2.5 inches\t Php. 80.00\n4. 3 inches\t Php. 90.00\n");
- scanf("%d", &schoice);
- switch (schoice)
- {
- case 1:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 60;
- break;
- case 2:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 70;
- break;
- case 3:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 80;
- break;
- case 4:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 90;
- break;
- default:
- printf("Option not found!");
- break;
- }
- break;
- case 3:
- printf("Thickness:\n1. 4.18 mm\tPhp. 400.00\n2. 3.80 mm\t Php. 350.00\n3. 3.42 mm\t Php. 300.00\n 4. 3.04 mm\t Php. 250.00\n");
- scanf("%d", &schoice);
- switch (schoice)
- {
- case 1:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 400;
- break;
- case 2:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 350;
- break;
- case 3:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 300;
- break;
- case 4:
- printf("Enter quantity to be purchased:\t");
- scanf("%d", &quantity);
- stotal = quantity * 250;
- break;
- default:
- printf("Option not found!");
- break;
- }
- break;
- default:
- printf("Option not found!");
- break;
- }
- total += stotal;
- }
- break;
- default:
- printf("Thank you for browsing!");
- break;
- }
- } while (x == 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement