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?
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?
>>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.
The code compiles, but I'm not sure if there are actually n queues.
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)
post code.
// 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;
}
}
}
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.
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;
}
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.
Can't figure out the problem
Can someone offer some advice?
As to what i'm doing wrong?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.