- Joined
- May 25, 2020
- Posts
- 1,550
- Solutions
- 1
- Reaction
- 4,128
- Points
- 928
Ang problema po kase ayaw gumana yung " getch; " at yung "while - do statement"
Help me po na mapagana ko po to...
Help me po na mapagana ko po to...
C:
#include<stdio.h>
#include<stdlib.h>
void main() {
int code, qty;
float price, amt;
char addAnother;
do {
system ("cls");
printf("======================\n"); printf("PIZZA BOX OVERLOAD MENU\n");
printf("======================\n\n");
printf("[1] Hawaiian Overload\t\tPhp 350.00\n");
printf("[2] Cheese Overload\t\tPhp 320.00\n");
printf("[3] All-Veggie Overload\t\tPhp 350.00\n");
printf("[4] All-Meat Overload\t\tPhp 370.00\n");
printf("[5] All-in Overload\t\tPhp 400.00\n");
printf("\nEnter Code\t: ");
scanf("%d", &code);
printf("\nEnter Quantity\t: ");
scanf("%d", &qty);
switch (code) {
case 1: price = 350.00;
break;
case 2: price = 320.00;
break;
case 3: price = 350.00;
break;
case 4: price = 370.00;
break;
case 5: price = 400.00;
break;
}
amt = price * qty;
printf("\n amount\t\t: %.2f", amt);
printf("\n\nAdd Another Order (y/n)?");
scanf("%d", &addAnother);
}while(addAnother == 'y');
getch();
}