Data Items the author, the entry contents, and the creatioin and modification da
ID: 3542166 • Letter: D
Question
Data Items
the author, the entry contents, and the creatioin and modification dates.
structrure
the strucure is via composition of the Text and Date ADTs.
Operations
BlogEntry();
Default constructor. creates an entry with unnamed author and empty contents. uses default constructor for all data items.
BlogEntry(const Text& initAuthor, const Text& initContents);
creates an entry initialized to the specified author and contents. uses the defaulf constructors for both Date objects.
Text getAuthor() const;
Getter for author. Return value of author object.
Text getContents() const;
getter for contents. returns value of contents objects.
Date getCreateDate() const;
getter for creation date. returns value of created objects.
Date getModifyDate() const;
getter for modification date. returns value of modified objects.
void setAuthor(const Text& newAuthor);
setter for author. sets the value of author object.
void setContents(const Text& newContents);
setter for contents. sets the value of contents object.
void showStructure() const;
outputs the contents of the BlogEntry.
void printHTML( ostream& out ) const;
private:
Text author;
Date created;
Date modified;
Text contents;
DATE ADT Specifications
data items - a day, month and year. all data values for these will start counting at 1, as is normal for dates.
Date();
default constructor. creates a date that represents the current date.
Date(int day, int month, int year) throw (logic_error);
constructor. creates a date that represents the specified date.
int getDay() const;
getter for day of month. returs the value of day.
int getMonth() const;
getter for month. returns the value of month.
int getYear() const;
getter for year. returs the value of year.
void showStructure() const;
static bool isLeapYear(int year);
Requirement - year is greater than 1901 A.D
static method. if the specified year is leap year, retur true else false.
static int daysInMonth(int month, int year);
req - year is greater than 1901.
static method. returns the number of days in specified month.
friend ostream& operator<<(ostream& out, const Date& date);
outputs the date in the same format as the showStrucure fuction to the appropriate ostream.
private:
int day;
int month;
int year;
Explanation / Answer
Find help at http://academicservices.us/ if you are stuck and let them know your budget for your assignment as i did.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.