Click here to Skip to main content
15,919,879 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A "C" programming equivalent to Windows + R run dialog invokcation Pin
David Crow20-Nov-20 3:02
David Crow20-Nov-20 3:02 
PraiseRe: A "C" programming equivalent to Windows + R run dialog invokcation Pin
Randor 21-Nov-20 20:46
professional Randor 21-Nov-20 20:46 
QuestionRe: A "C" programming equivalent to Windows + R run dialog invokcation Pin
Richard MacCutchan20-Nov-20 4:18
mveRichard MacCutchan20-Nov-20 4:18 
AnswerRe: A "C" programming equivalent to Windows + R run dialog invokcation Pin
samtoad20-Nov-20 13:22
samtoad20-Nov-20 13:22 
QuestionRe: A "C" programming equivalent to Windows + R run dialog invokcation Pin
David Crow20-Nov-20 16:36
David Crow20-Nov-20 16:36 
GeneralRe: A "C" programming equivalent to Windows + R run dialog invokcation Pin
Dave Kreskowiak20-Nov-20 17:17
mveDave Kreskowiak20-Nov-20 17:17 
GeneralRe: A "C" programming equivalent to Windows + R run dialog invokcation Pin
Randor 21-Nov-20 21:06
professional Randor 21-Nov-20 21:06 
QuestionBeginner problem c++ Pin
begzz17-Nov-20 11:02
begzz17-Nov-20 11:02 
QuestionRe: Beginner problem c++ Pin
David Crow17-Nov-20 14:49
David Crow17-Nov-20 14:49 
SuggestionRe: Beginner problem c++ Pin
Richard MacCutchan17-Nov-20 21:11
mveRichard MacCutchan17-Nov-20 21:11 
QuestionSetting Up Visual Studio Code & MinGW Pin
Member 1499476816-Nov-20 17:06
Member 1499476816-Nov-20 17:06 
AnswerRe: Setting Up Visual Studio Code & MinGW Pin
Richard MacCutchan16-Nov-20 21:42
mveRichard MacCutchan16-Nov-20 21:42 
AnswerRe: Setting Up Visual Studio Code & MinGW Pin
Dave Kreskowiak17-Nov-20 8:37
mveDave Kreskowiak17-Nov-20 8:37 
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 
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 

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.