Hi everyone, I’m Pete, moderately-experienced C++ user who is always looking for better ways to do things. Let me ask you guys about a problem I’ve scratching my head over lately. Suppose I’m writing a program designed to simulate a large company. I’m interested in tracking each company employee by the location where they work. This company has perhaps a thousand different locations: [CODE]class Employee { public: AccessorFunction1(); // does something AccessorFunction2(); // does something different AccessorFunction3(); // does something completely different protected: // Some data }; class Company { public: void OrganizeLocation(int a); protected: vector<Employee*> LocationA; vector<Employee*> LocationB; vector<Employee*> …

Member Avatar
Member Avatar
+0 forum 3

Hi, experts: I am very to c++, and here is a program that should: • create a Customer object– (although you will only be using one constructor here, be sure and test all three) • Display the Customer’s info using the ‘get’ functions • Ask the user how many months will be simulated • For each of N months (the number of months the user desired): Ask the user to provide all purchase amounts for the customer Ask the user to provide a payment for the customer Output the current balance for the customer Display the Customer’s info using the …

Member Avatar
Member Avatar
+0 forum 2

Hi everyone, I'm a moderate-level C++ programmer who is a little rusty at the moment. I've got an object question which is driving me nuts. I'm sure this is a C++ 101 level question, but for the life of me, I can't recall the solution. Basically, I've got one object which has to access private data in another object... and can't. Here's the specifics: I'm writing a little war game program where players deploy units (soldiers, tanks, planes, etc.) onto a gameboard. Players and Units are modeled as objects: [CODE]class GameUnit { public: string GetName() {return Name;} protected: string Name; …

Member Avatar
Member Avatar
+0 forum 7

The End.