Hi!
I cannot compile this program.
Please help me because I have no idea how I do it, my teacher spent this activity and I found it very difficult.
after completing an option, the program must return to the initial menu until "0" is pressed
Code:
#include <stdio.h>#include <conio.h>
int main ()
{
system ("CLS");
internal item [8] [5]; // matrix that will store how many items have been released
int op, wave, i, j;
float value [8] [5]; // matrix that will store the total value
float cash = 0; /// variable that will store the cash value
printf ("\ n");
printf ("| * -------------------- Welcome to the restaurant! ------------------- - * | \ n ");
printf ("\ n");
// Menu
printf ("[1] Open table \ n");
printf ("[2] Launch expenses \ n");
printf ("[3] Close the table account \ n");
printf ("[4] Check in the Cashier \ n");
printf ("[0] Exit \ n");
printf ("\ n Choose an option:");
scanf ("%d", & op);
switch (op)
// must receive only one character (1,2,3,4,0) without the need to press to enter any other number must be disregarded.
{
case 0:
printf ("\ n \ n Exiting the program \ n \ n");
break;
case 1:
printf ("Enter the table number:");
scanf ("%d");
if (item> = - 1) printf ("Table%d open");
else if (item <= 0)
printf ("Error, this table is not free. Choose another table!");
break;
case 2:
printf ("\ nValue posted on table \ n");
printf ("Release quantity:%d");
scanf ("%d");
printf ("Total table price: R$");
scanf ("%f");
if (table> = - 0) printf ("Table%d open");
else if (table <= -1)
printf ("Error, this table is not open!");
break;
case 3:
printf ("The table has just been closed");
// shows the total value of the table and the number of posted items that are in (case 2)
break;
case 4:
printf ("The total cash value: R $%.2f");
// the total cash value of all tables seems
break;
default:
printf ("\ n Invalid option! \ n \ n");
}
return 0;
}