File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Vector" Watch "Vector" New topic


Peter Mcmac

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

Dirk Schreckmann

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]
I agree. Here's the link:
subject: Vector
It's not a secret anymore!