Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Page 1 of 4 Copyright 2014, Dennis Rainey HW_7ab (2 parts) HW 7a Date class & Passing objects to a function Create 3 Files: Date

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Page 1 of 4 Copyright 2014, Dennis Rainey HW_7ab (2 parts) HW 7a Date class & Passing objects to a function Create 3 Files: Date h, Date cpp, and main.cpp File: Date.hCreate a class Date - Private data members (all ints): month, day, and year Methods o Default Constructor o parameters are passed from main). when an object is declared. The constructor sets data members to safe values " o Overloaded Constructor (another constructor with parameters) .At the time an object is declared, tree parameters are passed from main o Destructor o setDate . void-returning Month, day, and year values from main) are passed to this method The values are assigned to an object's data members o addDays void-returning One or more days can be added to the date. . .A value representing the number of days to be added is passed from main) The values are assigned to an object's data members An if-else structure is used to update the date. Important: To keep it simple, assume that each of the twelve months have 30 days. Ex: If the date is January 28th, and 4 days are added, then the date is changed to February 2nd... (as we will assume that January has 30 days) Ex If the date is December 30, 2007. and 1 day is added, (Again, we are assuming all months have 30 days.) then the date is changed to January 1st, 2008. o displayDate void-returning No parameters are passed from main0) An object's date is output to the screern The values can be used in main()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions

Question

=+10. How are inflation and unemployment related in the short run?

Answered: 1 week ago

Question

=+8. Why is productivity important?

Answered: 1 week ago