| Author |
Vector
|
Peter Mcmac
Greenhorn
Joined: Oct 31, 2002
Posts: 2
|
|
How would I go about designing a class named RealLife which will create 1 company and 5 employees.All Employees will be hired and 2 will be fired.Company must know how many employees it has at all times and what its payrooll is . Employee contains salary, ID, age, and position. Each has a name, gender, and an address. Company also has name and address. Can I somehow use vector.
|
 |
Bill Liteplo
Ranch Hand
Joined: Oct 16, 2002
Posts: 88
|
|
Wow, this homework problem almost writes itself. Hopefully you know how to write a class and give it member variables. I'll get you started: class Employee double salary int (or String or double...) ID int age String position String name String address boolean isMale (or String gender) class Company String name String address Vector employees class RealLife // do stuff Bill
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
Mighty Miramichi, Welcome to JavaRanch! We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy. Thanks Pardner! Hope to see you 'round the Ranch!
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
 |
|
|
subject: Vector
|
|
|