please write in C++ using #include using namespace std Define a class called DateYear, that represents any year like 2023 in addition to the day and month (03/34/2023). Your class will have one member variable of type int to represent the year. This class is a child of the DayOf Year class where the code is given in lecture14 (Lecture14_Code.cpp). Your DateYear class should have the following member functions: a constructor and a default constructor that sets the year to this year, month to 1 and day to 1. an input function that reads the date (day, month, and year). Make sure to check for inaccurate dates. -getter and setters for the year. an output function that outputs the date in form of xx/xx/xxxx. It can display to the screen or the file. A friend function DateCompare that compares two years and returns true if they are the same. A member function BDCountdown, which calculates and returns how many days till your birthday. This function take the birthday as the input parameter and returns the number of days left to the birthday which should be less than 365. Take note of the month in Gregorian calendar. The Gregorian calendar consists of the following 12 months: January 31 days February-28 days in a common year and 29 days in leap years March 31 days April - 30 days May 31 days June - 30 days July-31 days August 31 days September - 30 days October 31 days November 30 days December - 31 days You can put the days in an array to access them for computing the number of days. Embed your class definition in a test program. The test program should test all the attributes (every single function and all the data should be tested). All your inputs and outputs can be done using the keyboard and the screen. Even though your input/output functions can stream through files. So, how many days is left to your birthday? Note1: friend functions are not inheritable (the friend functions in lecture 14 code cannot be inherited by DateYear class) Note2: you can reuse function names and tailor them to the needs of the derived class.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

please write in C++ using #include <iostream> using namespace std

Define a class called DateYear, that represents any year like 2023 in addition to the day and month (03/34/2023). Your class will have one member variable of type int to represent the year.

This class is a child of the DayOf Year class where the code is given in lecture14 (Lecture14_Code.cpp).

Your DateYear class should have the following member functions:

a constructor and a default constructor that sets the year to this year, month to 1 and day to 1.

an input function that reads the date (day, month, and year). Make sure to check for inaccurate dates.

-getter and setters for the year.

an output function that outputs the date in form of xx/xx/xxxx. It can display to the screen or the file.

A friend function DateCompare that compares two years and returns true if they are the same.

A member function BDCountdown, which calculates and returns how many days till your birthday. This function take the birthday as the input parameter and returns the number of days left to the birthday which should be less than 365. Take note of the month in Gregorian calendar. The Gregorian calendar consists of the following 12 months:

January 31 days

February-28 days in a common year and 29 days in leap years

March 31 days

April - 30 days

May 31 days

June - 30 days

July-31 days

August 31 days

September - 30 days

October 31 days

November 30 days

December - 31 days

You can put the days in an array to access them for computing the number of days. Embed your class definition in a test program. The test program should test all the attributes (every single function and all the data should be tested).

All your inputs and outputs can be done using the keyboard and the screen. Even though your input/output functions can stream through files.

So, how many days is left to your birthday?

Note1: friend functions are not inheritable (the friend functions in lecture 14 code cannot be inherited by DateYear class)

Note2: you can reuse function names and tailor them to the needs of the derived class. 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education