๐Ÿ”’ Closed Pa help po sa code ko C programming

Status
Not open for further replies.

XsanX

๐‘ฉ๐‘ถ๐‘น๐‘ต ๐‘ป๐‘ถ ๐‘ฉ๐‘ฌ ๐‘ต๐‘ถ๐‘ป๐‘ฏ๐‘ฐ๐‘ต๐‘ฎ
Ang problema po kase ayaw gumana yung " getch; " at yung "while - do statement"

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();
}
 
Status
Not open for further replies.

About this Thread

  • 4
    Replies
  • 852
    Views
  • 3
    Participants
Last reply from:
Sheen_

Trending Topics

Online now

Members online
1,062
Guests online
937
Total visitors
1,999

Forum statistics

Threads
2,274,917
Posts
28,959,318
Members
1,233,485
Latest member
senpaikatzu_88
Back
Top