Discussion in 'C++' started by poopsy, Feb 16, 2007.

  1. poopsy

    poopsy New Member

    Feb 16, 2007
    Likes Received:
    Trophy Points:
    Hi kinda new here..wud b grateful if u cud help me wiv the following having problems dealing wiv classes questions though i think i understood it..
    i've tried to do it a bit.. here is the question

    The class Date has the following data members:
     Month
     Day
     Year
    and member functions:
     A default constructor that initialises all data members to zero.
     A constructor to create and initialise a Date object with the values passed as parameters
     Assigndate to assign values to the data members from the keyboard in the format:
    Day: 9
    Month: 10
    Year: 2002
     Displayshort to display a date in short form e.g. “09/10/2002”
     DisplayVerbose to display a date in form “October 9, 2002”
     NextDay to change the date to next day e.g. “October 10, 2002”

    (a) Write the class interface for the class Date.

    (b) Write the full function implementation for the member functions of the class Date.

    (c) Write a main program that declares two objects D1 and D2 of type Date. D1 must be initialised to the value “23 October 2002” and D2 must get its value from the keyboard. The program must then find the earlier of D1 and D2 and display the same in both formats. The program must also set the date D2 to next day and display the same in both formats.

    ive started by doin the 3rd part c directly..ive got only that until now:

      class Date{
        char month[10];
        int month;
        int day;
        int year;
        Date(char, int, int);
        void Assigndate();
        void Displayshort();
        void DisplayVerbose();
        void NextDay();
    void main(){
    Date D1,D2;
    cout<<"Enter the date"<<endl;
    plzzz help
    Last edited by a moderator: Feb 16, 2007
  2. shabbir

    shabbir Administrator Staff Member

    Jul 12, 2004
    Likes Received:
    Trophy Points:
    This forum is not assignment solution providers forum but we can help you if you can let us know whats the problem area.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice