comp.lang.ada
 help / color / mirror / Atom feed
From: "ramesh" <ramesh.mudedla@gmail.com>
Subject: Re: need help with errors im getting
Date: 25 Jun 2005 11:38:30 -0700
Date: 2005-06-25T11:38:30-07:00	[thread overview]
Message-ID: <1119724710.107186.139010@g47g2000cwa.googlegroups.com> (raw)
In-Reply-To: <pG6ve.9020$hK3.3246@newsread3.news.pas.earthlink.net>

Thank you jeff and Denis for your time to look at my code.
Here is the specification on which Im working right now.

Person -->	Employee, Student, Citizen

Here Person and Employee should be meta classes, and Employee, Student,
Citizen must inherit from Person.

Employee--->Faculty, Staff

The specification team is not currently able to supply the desired
level of detail.  However, based on the available information, the
design team has made the following decisions.  You may make reasonable
modifications to method parameter lists.  You may also add additional
data structures too class definitions.

Person		Employee		               Date
Name                        DateHired: Date;
Month
Birthday: Date;           Employee(n,dob,s,dh)               Day
Sex                           PrintDateHired()
Year
Person(n,dob, s)
PrintName()				Date()

        Date(mm,dd,yy)

        SetDate(mm, dd, yy)

         PrintDate()


"Person" and "Employee" must be implemented as abstract (meta
or virtual) classes!  Note that Birthday and DateHired are imbedded,
not inherited.  Months are to take on the values January through
December.  The year field may only take on values from 1800 through
2050.  Your code must enforce these abstractions at runtime.  The day
field must similarly be restricted to the values 1 through 31 (enforced
at runtime).  It is desirable to have two methods for creating dates:
first a method which initializes the date to specified values at the
time the date is created, and secondly a method that creates a date and
initializes it to the default value January 1, 1970.  Actually,
management would be impressed if the default is obtained from the
computer's clock.  If you implement this option, mark the code
clearly with a high lighter.  The method SetDate may be used to change
the current date.  Sex should be restricted to the values "male"
and "female."

If you implement faculty, staff, students, and citizens as tasks, their
body should consist of a loop where they wait for a call to any method.
 Respond to the method when called.  Every T seconds, they should
experience a time out where they state something of great importance
prior to resumption of waiting, e.g., "task named XXX is bored."

-------------------------------
Student	class
Major
Classification
EntryDate
Student(n, dob, s, maj, cl, ed)
PrintName()
PrintMajor()
SetMajor()
SetClassification()
PrintClassification()
PrintAll()
-------------------------------------------------------

Citizen	class
Hobby
Citizen(n, dob, s)
Citizen(n, dob, s, hobbyName)
Citizen(n, dob, s, hobbyName, doh)
PrintName()
SetHobby()
PrintHobby()
PrintAll()

Allowable majors include: Computer Science, Math, Business, Physics,
Biology, and Chemistry.
Classification may take on the values: Freshman, Sophomore, Junior,
Senior, and GradStudent.
The EntryDate for students is the date they first registered for
school.
Allowable hobbies include sail boarding, swimming, hiking, marbles, sky
diving, acting, and none.  If a hobby is not specified, the value of
Hobby should default to "none" and the date the hobby started to
January 1, 1970.  Date objects
---------------------------------------------------------
Faculty class
MajorField
Faculty(n, dob, s, hd, mf)
PrintName()
PrintHireDate()
PrintMajorField()
PrintAll()
------------------------------------------------------------


Staff  class

Hobby
DateOfHobby // date the hobby started
Staff(n, dob, s, hd, hobbyName, doh)
PrintName()
SetHobby()
PrintHobby()
PrintAll()

---------------------------------------------------------------------
Date class
Month
Day
Year
CreateADate()
CreateADate(M,D,Y)
SetDate(M,D,Y)
GetDate()
GetMonth()
GetDay()
GetYear()

Date should be implemented using embedding, not inheritance.  You must
be able to create a date supplying the month, day, and year.  You must
also be able to create a date with it defaulting to January 1, 1970.
Days should be constrained to the range 1 through 31 and years to the
range 1940 through 2020.




  reply	other threads:[~2005-06-25 18:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-24 21:59 need help with errors im getting ramesh
2005-06-24 22:42 ` Ed Falis
2005-06-25  1:43   ` ramesh
2005-06-25  6:17 ` Jeffrey Carter
2005-06-25 18:38   ` ramesh [this message]
     [not found]     ` <fovrb1t2l3nvsq6qden8vf2fkmgvg3614h@4ax.com>
     [not found]       ` <6g5sb1ptj1611oq6vbiirutlj9gv5lv39m@4ax.com>
2005-06-26  8:12         ` ramesh
2005-06-26  9:23           ` ramesh
     [not found]           ` <fu9ub1la6ofoc361j6pec48je2efh0b9e9@4ax.com>
     [not found]             ` <l3eub1l2ru5pguun3kitesfmgnfngur7vp@4ax.com>
2005-07-02  8:14               ` ramesh
2005-07-04  5:38               ` Dave Thompson
2005-07-04 21:16                 ` ramesh
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox