0

would other stores be able to interact with other stores registers?
Like if we were to compare two cash reigsters from two burger king stores, to see whicih one made the most.

Would that be possible?

0

>>would other stores be able to interact with other stores registers?

Yes you could compare the profits of one store against others, but you will have to add more information to those linked lists. But I'm not going to tell you how to do it. Get this part working first then you should be able to do that yourself.

0

The code compiles, but I'm not sure if there are actually n queues.

0

i put a counter in the for loop.

when it asks for how many stores.
I type 5.
then it gives me 11111 (5 1's)

0
// there are two structs
// store and cash_registers

store * head = NULL; // top of linked list
store * tail = NULL; // linked list tail

int number_of_stores = 0;
cout << "Enter the number of BurgerKings\n";
cin >> number_of_stores;

for(int i = 0; i < number_of_stores; i++)
{
    store * a_store= new store;
    a_store ->number = number_of_stores;

    a_store->next -> head = a_store;

    cout << "How many registers for this store?\n";
    int nRegisters;
    cin >> nRegisters;

    for(int j = 0; j < nRegisters; j++)
    {
            // create linked list for this store
	cash_registers * one_registers = new cash_registers;
            one_registers ->next = new cash_registers;
            one_registers -> next -> head = one_registers;
    }
     }
}
0

I assign number_of_stores to the first linked list data.
Because I think that'll be a good way to know which number the store is.

As the counter goes up.
The store linked list goes up.

0

I think I created bad code.
after I enter the numbers.
the cursor blinks, even when i type input.

#include <iostream>
#include <cstdlib>
#include <string>

using namespace std;

struct store {
    store *next;
    store *head;
    int number;
  
       };
       
struct cash_registers {
       cash_registers *next;
       cash_registers *head;
       //pointers for now
       };

int main() 
{
// there are two structs
// store and cash_registers

store * head = NULL; // top of linked list
store * tail = NULL; // linked list tail

int number_of_stores = 0;
cout << "Enter the number of stores";
cin >> number_of_stores;

for(int i = 0; i < number_of_stores; i++)
{
    store * a_store= new store;
    a_store ->number = number_of_stores;

    a_store->next -> head = a_store;

    cout << "How many registers for this store?\n";
    int nRegisters;
    cin >> nRegisters;

    for(int j = 0; j < nRegisters; j++)
    {
            // create linked list for this store
	cash_registers * one_registers = new cash_registers;
            one_registers ->next = new cash_registers;
            one_registers -> next -> head = one_registers;
    }
     }

    system("PAUSE");
    return 0;
     
       
}
0

nvm, changing the system("PAUSE");

to a cin.get()

changed the running time outcome.

it asked for how many stores.
then ask for how many registers.
then asked it again then it shuts off.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.