// 11022009.cpp, P H Anderson, Nov 2, '09

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

typedef struct N
{
    int id;
    char food[5];
    struct N *next;
} NODE;    


NODE *h;

void add_to_line(int id, char food[] ); // always add to the end
float remove_from_line(void);
void print_line(void);

#define PRINT(x) printf(#x)

int main(void)
{
    int id;
    char op, food[5];
    float cash, money_in_register = 0.00;

    h = NULL; 
    while(1)
    {
        PRINT(Enter command + / - / p / $ / x:);
        fflush(stdin);
        scanf("%c", &op);

        switch(op)
        {
            case '+':  PRINT(Enter id and food:);
                       scanf("%d %s", &id, food);
                       add_to_line(id, food);
                       break;

            case '-':  money_in_register = money_in_register + remove_from_line();
                       break;

            case 'p':  print_line();
                       break;

            case '$':  PRINT(Money in Register is );
                       printf("%.2f\n", money_in_register);
                       break;

            case 'x':  exit(0);

            default:   PRINT(Unknown Command\n);
                       break;

        }
    }
}

void add_to_line(int id, char food[])
{
   PRINT (stub - add to queue\n);
}

float remove_from_line(void)
{
   // YOGT is $2.50, MUSH is $4.50, all others $3.00     
   PRINT (stub - remove from queue\n);
   return(2.50);
}

void print_line(void)
{
    PRINT (stub - print the line\n);
}