struct Fast_Food_Business
    {
       string name;  
                 Fast_Food_Business* head;
                Fast_Food_business* tail;

                         };

      struct cash_registers{
         Fast_Food_Business * regist;
         cash_registers * r; 

    }

        struct Customer
        { 
           int n;
           Customer * h ; // head
           Customer *t; // tail
           Fast_Food_Business*next;
            };

     bool menu (const char& number)
     {
      return number== '1' ||      number== '2';

                       }

     bool sub_menu (const char& alphabet)
     {
        return alphabet== 'a' ||    alphabet== 'b' ||
           alphabet== 'c' ||    alphabet== 'd' || 
                                   }

     int main()
   {    
    int Restaurant= 0;

    cout<<"How many Restaurants?"<<endl;
    cin>>Restaurants;

    Fast_Food_Restaurant* aRestaurant= new Fast_Food_Restaurant;
    aResturant-> h = NULL;  //top of linked list
    aRestaurant-> t = NULL;  // linked list tail

    for(int i = 1; i < Resturants; i++)
    {   
        aRestaurant -> n = NULL;
        // now add to linked list
        if( aResturant -> h== NULL)  
        {
          aResturant-> h = aRestaurant-> t= aRestaurant;
                                      }
        else
        {
         // add new node to end of linked list
         aRestaurant -> t= aRestaurant-> n = aResturant;
         aResturant -> t= aResturant;
                                       }


                                       }

int customer = 0;
cout " how many customers";
cin>>customer;

      for (int i=0; i<customer; i++)
  { 
     char choice; 
     cout<<"What would be your choice?";
     cin>> choice;

     if( menu(choice))
    {   
        if (menu== '1')
        {

    cash_register * cr = new cash_register;
        cr = NULL;

        if (CR== NULL)
        {
            aResturant = CR; }  


  cin.get();
  return 0;     
}

This is my Code I have now.
So I'm hoping that this code right now does this.

Judging on how many restaurants the user inputs.
It creates that many queues.

Then there are customers.

I want the customers to be able to be able to choose which restaurant they want to go to.

So say if the user types in there are five restaurants.
Then they'll be five restaurant queues.

Is there a way for the user to say, I want to go to restaurant queue 3?

Then when the user chooses something from the menu.
A cash register is created.
Then if the cash register is NULL, then it goes to that restaurant queue, in this case, the cash register goes to restaurant queue 3.

etc.

Could someone point me to the right direction?

Edited 3 Years Ago by mike_2000_17: Fixed formatting

Is there a way for the user to say, I want to go to restaurant queue 3?

Yes, create an array of restaurants and access each 'restaurant' via it's subscript :)

I been pulling my hair for the past few days.
How could one implement it using queues/linked list?

Using a counter?
And that counter is pointing to a linked list/queue?


Also, how can I have the cash register pointer point to the restaurant pointer?

Should I overload the operator? or something?

I agree with him, the concept is easy.
It's just putting it down on paper that's the hard part.

This article has been dead for over six months. Start a new discussion instead.