Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Offline Score: Add Comment 0 5 Anonymous Grading:no Exercise 1 : ADT Instructions: Date Class Write a C + + class definition for an abstract

Offline Score:
Add Comment
05
Anonymous Grading:no
Exercise 1: ADT
Instructions:
Date Class
Write a C++ class definition for an abstract data type called Date that models a day of the year. The Date class stores the year, month, and day. Your class should implement the following member functions:
A default constructor with no user-provided arguments.
A constructor with three integer arguments - the month, and day in that order. Use the arguments to initialize the data members.
void setDate (int year, int month, int day): Sets the year, month, and day of the invoking Date object.
string getDate() : Returns the string version of the date in mmddyyyy format.
1: Returns the string "Winter", "Spring", "Summer", or "Fall" based on the season. Use the following dates as a guide:
First day of Spring: March 21
First day of Summer: June 21
First day of Fall: September 23
First day of Winter: December 22
Client program
Once you have created the Date class, create a client program inat displays the date in mm/dd/yyyy format (calls getDate function) and shows the season (calls function) for each of the following dates:
image text in transcribed

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

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions