Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
I managed to compile only that now what I'm having difficulty is to make the program return to the menu at the end of the command so that new commands are given and the values ​​are saved in the box.

(I'm sorry if my English is bad, I am translating to clear my doubts here.)


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

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


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 press the enter any other number should be disregarded.
	    {
	    case 0: 
		    printf("Leaving");
		   break;
		   	   
case 1: 

printf ("Enter table number: ");
scanf ("%d",&i,&j);

if (item <=-1) //item=-1 closed table
printf("open table %d \n ",i,j);
else //////
if (item>=0) //item =0 closed table
printf("This table is not free. Choose another table!");
break;


case 2:
printf ("Enter table number:");
scanf ("%d",&i,&j);
if (item <=0) //item =0 open table
printf ("Enter with the value to be launched on the table %d: R$ \n ",i,j);
scanf ("%.2f",&i,&j,&value);
printf(" Value launched on the table.\n ");
printf("Amount posted: \n"); // show how many postings were on the table
printf(" Total table value: %.2f \n",value);

 (item >=-1);
printf(" Error: This table is not open! \n"); //item=-1 table closed

  break;
	    case 3:
printf ("Enter table number:");
scanf ("%d",&i,&j);

printf(" The table has just been closed \n");
printf(" Amount of postings: \n"); // show how many postings you had on the table
printf(" Total value of the table %d e' R$ %.2f \n",i,j,value);

                                                 
		   break;
	    case 4: 
            printf("The total value in the box: R$"); // should show the total value you have in the box of all tables that have already been opened
             scanf("%f",&box);                                                
		    break;

}
return 0;
}

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 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard MacCutchan31-Oct-20 21:22
mveRichard MacCutchan31-Oct-20 21:22 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard Andrew x641-Nov-20 9:58
professionalRichard Andrew x641-Nov-20 9:58 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard MacCutchan1-Nov-20 21:58
mveRichard MacCutchan1-Nov-20 21:58 

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.