Click here to Skip to main content
16,016,770 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPrime Number Code C Pin
iHuy14-Nov-20 22:06
iHuy14-Nov-20 22:06 
AnswerRe: Prime Number Code C Pin
_Flaviu14-Nov-20 23:30
_Flaviu14-Nov-20 23:30 
QuestionRe: Prime Number Code C Pin
David Crow15-Nov-20 4:21
David Crow15-Nov-20 4:21 
QuestionC++ compiler that supports multiple inheritance Pin
Member 1274166010-Nov-20 1:26
Member 1274166010-Nov-20 1:26 
AnswerRe: C++ compiler that supports multiple inheritance Pin
Mircea Neacsu10-Nov-20 1:30
Mircea Neacsu10-Nov-20 1:30 
AnswerRe: C++ compiler that supports multiple inheritance Pin
CPallini10-Nov-20 2:13
mveCPallini10-Nov-20 2:13 
GeneralRe: C++ compiler that supports multiple inheritance Pin
Member 1274166017-Jul-23 20:19
Member 1274166017-Jul-23 20:19 
QuestionI can't compile and put it as a variable and matrix Pin
Member 149848945-Nov-20 5:45
Member 149848945-Nov-20 5:45 
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.

C++
<pre>
#include <stdio.h>
#include <conio.h>

int main()
{
system("CLS");
int item [8][5]; // matrix that will store how many items have been released
int op,vaga,i,j;
float value[8][5]; //matrix that will store the total value
float box = 0; /// variable that will store the value of the box

printf("\n");
	printf ("|*--------------------Welcome to the restaurant! -------------------- *|\n");
printf("\n");

				//Menu
printf(" [1] Open table\n");
printf(" [2] Launch expense\n");
printf(" [3] Close table account\n");
printf(" [4] Check Cashier\n");    
printf(" [0] Exit\n");
printf("\n Choose an option:");
scanf ("%d",&op);
switch (op)
	  // should receive only one character which are the (1,2,3,4,0) without the need to prefix the enter any other number should be disregarded.
	    {
	    case 0: 
		    printf("Leaving the Program");
		   break;
case 1: 
printf ("Enter table number:");
scanf("%d");
if (item>=-1) printf("%d table open");
else if (item<= 0)
printf("Error that table is not free. Choose another table!");
		    function_open_table();
		    break;
	    case 2:
		    printf("Value launched on table");
		    printf("Placement amount: %d");
		    scanf("%d");
		    printf("Total value of the table:R$ ");
		    scanf("%f");
		    if (table>=-0) printf("%d table open");
else if (table<= -1)
printf("Error that table is not open!");
		    	 function_Launch_dispatch();
		    break;
	    case 3:
	    	printf("The table has just been closed");
                                                    // the total value of the table and the amount of posted items that are in (case 2) appear
		   break;
	    case 4: 
            printf("The total value in the box: R$%.2f");
                                                             // the total value of the box of all the tables
		    break;
	    default:
		    printf("option invalidates!");
	    }
	return 0;	
}

AnswerRe: I can't compile and put it as a variable and matrix Pin
Victor Nijegorodov5-Nov-20 6:58
Victor Nijegorodov5-Nov-20 6:58 
AnswerRe: I can't compile and put it as a variable and matrix Pin
jeron15-Nov-20 7:17
jeron15-Nov-20 7:17 
AnswerRe: I can't compile and put it as a variable and matrix Pin
Member 149848945-Nov-20 11:57
Member 149848945-Nov-20 11:57 
GeneralRe: I can't compile and put it as a variable and matrix Pin
jeron15-Nov-20 12:29
jeron15-Nov-20 12:29 
GeneralRe: I can't compile and put it as a variable and matrix Pin
Member 149848945-Nov-20 12:47
Member 149848945-Nov-20 12:47 
GeneralRe: I can't compile and put it as a variable and matrix Pin
jeron15-Nov-20 14:21
jeron15-Nov-20 14:21 
GeneralRe: I can't compile and put it as a variable and matrix Pin
jsc4226-Nov-20 5:55
professionaljsc4226-Nov-20 5:55 
GeneralRe: I can't compile and put it as a variable and matrix Pin
David Crow9-Nov-20 2:52
David Crow9-Nov-20 2:52 
GeneralRe: I can't compile and put it as a variable and matrix Pin
jeron19-Nov-20 4:05
jeron19-Nov-20 4:05 
Questioni need your help Pin
Member 149820522-Nov-20 11:09
Member 149820522-Nov-20 11:09 
AnswerRe: i need your help Pin
Victor Nijegorodov2-Nov-20 20:36
Victor Nijegorodov2-Nov-20 20:36 
QuestionDifference between current system time and time from user input in c Pin
Member 1497910831-Oct-20 6:00
Member 1497910831-Oct-20 6:00 
AnswerRe: Difference between current system time and time from user input in c Pin
Mircea Neacsu31-Oct-20 6:59
Mircea Neacsu31-Oct-20 6:59 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard Andrew x6431-Oct-20 8:03
professionalRichard Andrew x6431-Oct-20 8:03 
GeneralRe: Difference between current system time and time from user input in c Pin
Mircea Neacsu31-Oct-20 8:14
Mircea Neacsu31-Oct-20 8:14 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard MacCutchan31-Oct-20 9:38
mveRichard MacCutchan31-Oct-20 9:38 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard Andrew x6431-Oct-20 10:28
professionalRichard Andrew x6431-Oct-20 10:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.