Thread: I can't do the commands

  1. #1
    Registered User
    Join Date
    Nov 2020
    Posts
    4

    I can't do the commands

    Hi!
    I'm trying to create a 2-day restaurant program, but I can't get the program to open the table when I press button 1. To give the commands
    (1 ° insert table number 2 ° open table) and if the table is occupied, show ": this table is not free. Choose another!"
    The free table matrix (item = -1) and whether it is occupied (item = 0).
    Code:
    #include <stdio.h>#include <conio.h>
    
    
    
    
    int main ()
    {
    internal item [8] [5], i, j;
    int table, op,vacancy
    float value [8] [5];
    cash float = 0;
    char err = 0;
    
    
    
    
    printf ("\ n");
    {
    printf ("| * -------------------- Welcome to the restaurant! ------------------- - * | \ n ");
    printf ("\ n");
    
    
    {
    printf ("[1] Open table \ n");
    printf ("[2] Launch expense \ n");
    printf ("[3] Close the table account \ n");
    printf ("[4] Check the Cashier \ n");
    printf ("[0] Exit \ n");
    printf ("\ n Choose an option:");
    scanf ("% d", & op);
    }
    
    
    printf ("Enter the table number:");
    scanf ("% d");
    
    
    }
    
    
    
    
    return 0;
    }
    Last edited by Patricia F; 11-03-2020 at 05:02 PM.

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User
    Join Date
    Sep 2020
    Posts
    150
    internal, item and cash are not valid C keywords.
    In scanf you shouldn't have a space between % and d
    You need to implement the functionality of the menu items.

  4. #4
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,110
    Quote Originally Posted by Patricia F View Post
    Hi!
    I'm trying to create a 2-day restaurant program, but I can't get the program to open the table when I press button 1. To give the commands
    (1 ° insert table number 2 ° open table) and if the table is occupied, show ": this table is not free. Choose another!"
    The free table matrix (item = -1) and whether it is occupied (item = 0).
    Before you attempt to program in C, you first need to study a good book on the C Programming Language, cover to cover, and do all the exercises at the end of each chapter! Choose one of the three listed below:

    C Programming, A Modern Approach
    Author: K. N. King

    C Primer Plus, 6th Edition
    Stephen Prata

    C How to Program, 8/e
    Deitel & Deitel

    You also need to compile with the error/and warnings turned on, and turned up to see all the warnings.

    conio.h is a non-standard Windows only header file.

    Please also choose an indent style.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MS-DOS commands...
    By MipZhaP in forum C++ Programming
    Replies: 9
    Last Post: 08-19-2004, 03:52 AM
  2. DOS Commands
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 05-13-2002, 03:40 AM
  3. commands
    By c++.prog.newbie in forum Windows Programming
    Replies: 1
    Last Post: 02-24-2002, 08:50 PM
  4. DOS Commands
    By Zuul in forum C++ Programming
    Replies: 11
    Last Post: 01-04-2002, 04:41 PM
  5. How to run DOS commands from c++
    By ihsir in forum C++ Programming
    Replies: 2
    Last Post: 12-05-2001, 05:59 AM

Tags for this Thread