System For Yahoo and Bing

I am developing a system that will track employee info.. for two org ... e.g yahoo and bing... Information will be name, sex, job , org they work.. DOB.. Then we must also track info of org name and number of employee..
and system should compare any two employee...
Give me idea how to build this system... Should i use inheritance or it could be build in simple classes.. and give me some idea how to do this.

and one more question I am creating string variable for all these but its not working ..

1
2
3
4
5
6
7
8
9
10
11
12
13
#include<iostream.h>
#include<string.h>

class Employe
{
	protected:
		string employeName;
		string employeSex;
		string employeJob;
		string employeOrganization;
		string employeBirthday;

};
try std::string employeName;

or after the includes add using std::string or using namespace std
I am using Microsoft Visual C++ 6.. Its work without these but let me try..
and kindly give idea for problem.
But you just said it wasn't working.
If you really want to over engineer this, you could make another class for organizations.

Something like:
1
2
3
4
5
class Organization
{
	string name;
	vector<Employe> lackeys;
}


then have a separate Organization object for each company.
what does vector employe means ?? and what is lackeys?
Should i use inheritance or it could be build in simple classes.
Sometimes inheritance (generalisation in UML speak) falls out of a design because it's obvious. But you shouldn't try to use it.

For example, let's consider Employee from your previous work. You could take the view that there's an Employee base class and derived kinds of Employees like Programmer and Tester. But that's contrived. If you think that a person can be a Team Leader and a Programmer at the same time, the model doesn't fit.

An alternative model is an Employee has Roles. The role can be a job. That could better represent someone being a Manager on one project, and a Team Leader on another while being a Programmer at the same time. In UML, you'd say an Employee is associated with one or more Roles.

Regarding your non-working example, you should NEVER USE PROTECTED DATA. There are two relevant abstractions here, Abstract Data Types and Objects.

Abstract Data Types are black boxes. You never see what's inside, you only access the functions that interface to it. For example a File. In the C standard library, there's FILE. You create one with fopen(), close it with fclose(), read from it with fread(), write to it with fwrite() and so on, but you never look at FILE.

Objects are black boxes too, but the model expresses relationships with other Objects. You can only send an object a message and get a reply; and that's it. Objects implement methods that implement the interface. In C++, objects are efficiently implemented by representing methods as virtual functions so the system can be validated at compile time (rather than when the program is running).

None of these models support protected or public data, and neither should you.

Your code wasn't working because you have a syntax error, you omitted the namespace for string, and you have the wrong header file. The code should be:
1
2
3
4
5
6
7
8
9
10
11
#include <string>

class Employe
{
private:
	std::string employeName;
	std::string employeSex;
	std::string employeJob;
	std::string employeOrganization;
	std::string employeBirthday;
};
Topic archived. No new replies allowed.