Pular para o conteúdo principal

Postagens

Mostrando postagens com o rótulo programa!Programa calculo consumo bar!

C++, snack bar or Theater, programa!Programa calculo consumo bar!

/* Theater lobby snack bar program */ #include #include #include #define TRUE 1 //This is true #define FALSE !(TRUE) //This is not true void main() { char c; //their choice int done; //while loop ender float total=0; //start their total at zero; printf("Please make your treat selections:\n"); printf("B - Beverage.\n"); printf("C - Candy.\n"); printf("H - Hot dog.\n"); printf("P - Popcorn.\n"); printf("= - Done.\n"); printf("Your choice:\n"); /* Now you must figure out what they typed in. */ done=FALSE; while(!done) { c=toupper(getch()); //get input switch(c) //find the key they pressed { case 'B': //Beverage printf("B - Beverage\tThat will be $2\n"); total+=2; break; case 'C': //Candy printf("C - Candy\tThat will be $1.50\n"); total+=1.5; break; ...