944,205 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 4094
  • C RSS
Feb 14th, 2006
-1

Design and Implement a class hierarchy for an organization/university

Expand Post »
Design and implement a class hierarchy for any organization, employees. We are interested in modeling only the Managers and Faculty. Director shall be treated as a Manager. The following information for each employee needs to be captured:

First Name, Middle Initial, and Last Name
All of above are of type string except Middle Initial that is of type Character.

All Managers belong to certain Level which are numbered 3 through 5 and
all managers must belong to one of the university department (a string).
Director, though Manager, does not belong to any level and also does not belong
to any department. Each faculty member is either professor, Associate or
Assistant Professor and belongs to some department.

We are only interested in creating objects of different types of employees
(i.e. Managers, Faculty Members, or Director) and to print the relevant
information for each employee in the following format.

for Manager the output of function should be of the form:
First Name, Middle Initil, Last Name Department Level

for Director the output of function should be of the form:
First Name, Middle Initil, Last Name “Director�

for Faculty the output of function should be of the form:
First Name, Middle Initil, Last Name Department Position


a) Show a complete class diagram against the system described above.

b) Implement Manager and Director Classes described in the class diagram above.

c) Implement a global non-template method PrintDetail() that accepts any kind of university employee and print all its relevant details.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bashi is offline Offline
7 posts
since Feb 2006
Feb 14th, 2006
3

Re: Design and Implement a class hierarchy for an organization/university

Quote originally posted by bashi ...
Design and implement a class hierarchy for any organization, employees.
Why would I want to do that?
Team Colleague
Reputation Points: 1135
Solved Threads: 173
Super Senior Demiposter
Rashakil Fol is offline Offline
2,480 posts
since Jun 2005
Feb 14th, 2006
0

Re: Design and Implement a class hierarchy for an organization/university

Quote originally posted by Rashakil Fol ...
Why would I want to do that?
its not necessary dear that u will do if u can help me out its ok if not it also ok
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bashi is offline Offline
7 posts
since Feb 2006
Feb 14th, 2006
0

Re: Design and Implement a class hierarchy for an organization/university

Quote originally posted by bashi ...
Design and implement a class hierarchy for any organization, employees. We are interested in modeling only the Managers and Faculty. Director shall be treated as a Manager. The following information for each employee needs to be captured:
This is the sort of problem usually given to 1st-year students.
Not to say that means it's a total no-brainer, but come on, do a bit of reading! you've been given all the information on a nice big round plate, you just need to work those brain cells a little to seperate it out.

Quote originally posted by bashi ...
First Name, Middle Initial, and Last Name
All of above are of type string except Middle Initial that is of type Character.
Have you done any database work? Imagine you are setting up an MS Access database, you will find the data relationship diagram is just the same! You've just been given 3 field names (variables) here... field names/variables are like attributes of your Objects (in this case, Objects are people..)

Quote originally posted by bashi ...
All Managers belong to certain Level which are numbered 3 through 5 and
all managers must belong to one of the university department (a string).
Director, though Manager, does not belong to any level and also does not belong
to any department. Each faculty member is either professor, Associate or
Assistant Professor and belongs to some department.
Here are more fields/attributes.. and also clues as to what sort of classes/people you should be thinking about..

Quote originally posted by bashi ...
We are only interested in creating objects of different types of employees
(i.e. Managers, Faculty Members, or Director) and to print the relevant
information for each employee in the following format.
OK.. break it down a little.. use a pen & paper to list all your different types of people, and all your types of attributes..

Quote originally posted by bashi ...
for Manager the output of function should be of the form:
First Name, Middle Initil, Last Name Department Level

for Director the output of function should be of the form:
First Name, Middle Initil, Last Name “Director�

for Faculty the output of function should be of the form:
First Name, Middle Initil, Last Name Department Position
Again, you've been given field names on a plate! see if you can link attributes and people together on paper, this will be the beginning of your class diagram

Quote originally posted by bashi ...
a) Show a complete class diagram against the system described above.

b) Implement Manager and Director Classes described in the class diagram above.

c) Implement a global non-template method PrintDetail() that accepts any kind of university employee and print all its relevant details.
and here you have been given a Method/Function.. but worry about that later, you need to get your data diagram sorted on paper, else you'll be going nowhere fast.. You'll be surprised how simple the problem is once you have a visual aid.

So, which field names are common to all your classes? these 'common' attributes will be inside your base class.. and inherited by the derived classes.
(HINT - in a good system, data shouldn't be dupilicated anywhere unnecessarily)
Reputation Points: 307
Solved Threads: 62
Posting Pro
Bench is offline Offline
565 posts
since Feb 2006
Feb 16th, 2006
0

Re: Design and Implement a class hierarchy for an organization/university

thnks for your repy bench i will do the code part if u can help me plz do hlp me in this i cant understand how i will Show a complete class diagram against the system described above.
i hope u will help me.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bashi is offline Offline
7 posts
since Feb 2006
Feb 16th, 2006
0

Re: Design and Implement a class hierarchy for an organization/university

Quote originally posted by bashi ...
thnks for your repy bench i will do the code part if u can help me plz do hlp me in this i cant understand how i will Show a complete class diagram against the system described above.
i hope u will help me.
I'm feeling generous today, so I'll give you the benefit of the doubt. However, if your next post fails to give sufficient proof that you've made any attempt at solving this, your thread will be locked and I'll make sure that your user record shows that you knowingly broke an oft stated rule of the forum (ie. No homework questions without proof of effort).
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Feb 16th, 2006
0

Re: Design and Implement a class hierarchy for an organization/university

Quote originally posted by bashi ...
thnks for your repy bench i will do the code part if u can help me plz do hlp me in this i cant understand how i will Show a complete class diagram against the system described above.
i hope u will help me.
The class diagram should be easy - it is just a paper representation of your program's basic structure, using graphical and/or psuedo-code. Read what I said above about writing a list of all your different "types" of people, and all the different attributes you need to store (your assignment has it all written down for you, you just need to read it)

Take, for example, a diagram involving modes of road transport - You need to know some information about all types of transport, like what's the vehicles manufacturer & model? for specific types, like a Car, you want to know about it's engine - although Bicycles don't use engines, but Bicycles will have Reflectors on them to make them more visible


Vehicle - Base Class
  • People_Capacity
  • Manufacturer
  • Model_Number



Car - Derived from Vehicle
  • Num_Of_Doors
  • Engine_Size



Bicycle - Derived from Vehicle
  • Frame_Type
  • Num_Of_Reflectors



You should also include functions, for example, the base class could have a Change_Gear() function, as both Bicycles and Cars use gears - however, only Cars might have a Start_Engine() function.
Reputation Points: 307
Solved Threads: 62
Posting Pro
Bench is offline Offline
565 posts
since Feb 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: pls help me to convert char to integer.
Next Thread in C Forum Timeline: Audio measurement dll using sound card?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC