This question's due date has already passed. You may post a tutorial, but there's no guarantee that the original asker will purchase the tutorial. But other people might!

Question

$20.00 Program composition

Asked by :
agogo9
agogo9 Not confirmed
Rating :No Rating
Questions Asked: 12
Tutorials Posted: 0
 
 
Q:


Write a Date Class to add to the program you wrote last week (The Student Class
Program)
One basic rule of OO programming is not to save anything that can be calculated.
The date class will allow you to calculate the student’s age.

A date class

 o Attributes

  § Day

  § Month

  § Year

o Behaviors

    § Set and
       get each attribute

    § Calculates age in a behavior
       called calcage( ) that determines a person’s age as of today

Validate
each attribute – as part of the set method call the validate methods

Day

       1 to the number of days in the month

       Don’t forget leap year. Leap year is more than every 4th year is a leap year – look it
up



Month

         Accept 3-letter abbreviations; Jan, Feb, Mar, . . .

                          Make the input case insensitive. Also accept integers, 1 – 12

 



Year

          Is 99 a valid year? Is 10 a valid year?

          If 99 means 1999 does 10 mean 1910?

          Define a year format and enforce it.

 



Add birth date as an attribute to your Student – an abstract variable (one created
from an abstract data type) that is an attribute of another abstract data type
(such as your Student Class) illustrates Composition.

Add methods to your StudentManip class to input (set) the student’s birth date and
to calculate the student’s age. Add the student’s age to the display classes.

 

Available Tutorials to this Question
 
$5.00
your assignment is attached hear.(100 % origial) A++ work
  • This tutorial hasn't been purchased yet.
  • Posted on May. 22, 2012 at 12:18:38AM
Posted by :
johnxt
johnxt
Rating (4):D
Questions Asked: 2
Tutorials Posted: 53,
Earned: $33.30
 
A:
Preview: ... is attached ...

The full tutorial is about 9 words long plus attachments.

attachmentlogo

Attachments:
assignment.xlsx (11K)