Hi all, I've thought of a local small business venture I might pursue and I realized I'll need a point of sale system. I'm beginner to intermediate in c++ but I think if i work on it for a month or so I'll be able to build it myself and not waste a lot of money. Plus it will be phenomenal experience since I'm still actively learning c++.
Anyways, the POS doesn't seem to be very complex conceptually, but when I sat down to start I'm having a little trouble wrapping my head around it because I've never actually built an entire program with many many different modules etc. I'm sort of just looking for someone to give me some advice on how to approach the problem from a conceptual point of view.
Its sort of a storage type of thing where a person will make an account (in person) and can use a card I will provide to store one item in a type of "pouch". These "pouches" would be organized in this way: a1-a20 then b1-b20, c1-c20, etc. up to z20 (making a total of 520 "pouches") and you can put ONE ITEM in each pouch. basically I need the POS system to ASSIGN AN ITEM TO AN OPEN POUCH.
If the pouch is open (ex. a12) store the item and "close" the pouch until the item is removed.
If the pouch is already "closed" (in use), assign the item to the next available pouch (a13)
so how do i approach this?
should there be a "class Customer" that will be used to create objects that represent one person's account (they will have to register with certain information before they can use the storage service)
Should there be a "class Storage" to have member functions such as "storeItem()" or should storeItem() be a part of "class Customer"?
I'm not even really sure what the right questions to ask are. The main idea is that i have 500 people that want to store 1-5 items (each item in a different pouch), i want to be able to put the person's ID number into the program (a number that they will receive upon an initial registration and their information being input into the system) and it automatically assigns a pouch for their item, if they have another item, it assigns a new pouch to that one. When they come to pickup their items, the pouch goes back to being empty and available for storage and the process repeats until all 500 customers have stored and "unstored" their items.
So how many different classes will I need?
How should i represent the "pouches"? As object of their own class or simply as an array of integers (1 for full 0 for empty)?
Just some general questions and help would be greatly appreciated.
struct Storage
{
struct Customer
{
...
};
struct Pouch
{
CustomerId cid;
ItemId iid;
...
};
std::list<Pouch*> freePouches; // List of (pointers to) free pouches.
std::list<Pouch*> usedPouches; // List of (pointers to) used pouches.
std::list<Customer*> registeredCustomers; // List of registered customers.
CustomerId registerCustormer(...); // Register a customer, specifying all the required info.
// Returns CustomerId which can be a pointer to Customer.
PouchId assign(CustomerId, ItemId); // Assign customer/item to the first free pouch.
// Returns PouchId which can be a pointer to Pouch.
void deassign(PouchId); // Deassign the given pouch and move it back to the free list.
};