Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 06-10-2004, 06:45 AM   #1 (permalink)
 
Super Techie

Join Date: Nov 2003

Posts: 437

madking153 is on a distinguished road

Send a message via ICQ to madking153
Default Nedd help in date class

Iam a amature in programming ,I know the basic of C++ , so i need help in my homeworkls show me how to do it and explain.
iwill really appreciate.Below is the homework


//File date.h: class definition

class date {

int day;
int month;
int year;

public:
Date(); //sets to valid default date

void setDate(int d,int m,int y);

//sets to given date and corrects if necessary

void outputCout(); //outputs day/month /year to cout


// ...

private :

//....

};

//*************************************************

// File date.cpp : definitions of the member funtions of class date


#include"date.h"
//..... //member function definition

//*************************************************

// File main.cpp : test program for class Date

#include"date.h"

int main()
{
Date test;

test.setDate(31,12,2001);
test.outputCout();

//.......

return 0;

}



--------------------------------------------------------------------
The member functions are defined completely in the file date.cpp so that the main program run properly- also for other date values .Only the parts important for comprehension are shown; missing parts are indicated with comments .
Write the following member functions:

void monthBegin(); //alters date to the beginning of this month
void nextmonthBegin(); //alters date to the first of the next month


The following parts are required for both functions:
.declaration of the member functions in the class definition
.definition of the member function in the file date.cpp
.extension of the main program to test these 2 new member functions ,to be precise,each with 2 different date values that are present in the program
madking153 is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On