Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CECS 282-05-Spring 2018 C++ for Java Programmers Program 2 -ADT (Date Object) Due: Feb 27, 2018 Create a C++ class called myDate. It should have

image text in transcribed
image text in transcribed
image text in transcribed
CECS 282-05-Spring 2018 C++ for Java Programmers Program 2 -ADT (Date Object) Due: Feb 27, 2018 Create a C++ class called myDate. It should have the following operations: my Date0 -default constructor. This will set the date to May 11, 1959 passed in through the parameter list represented by Month, Day and Year. . my Date(int M, int D, int Y)-overloaded constructor. This will set the date to the values void display0-display the date in the following format (May 11, 1959) Do NOT printa linefeed after the date. . void increaseDate(int N)- increment the date by N days . void Between(myDate D) - return the number of days between this date and the date is a future date, the return value will be a positive int. If date D is in the dos ultracHun D. If date D past, the return value will be a negative int . int getMonth0 -return the month in integer form int getDay0- return the day of the month .int getYear) - return the year . int dayOfYyearo- return the number of days since the current year began Example lan tat string dayName0-returns Monday, Tuesday, etc according to the day of the week. Write a driver program that fests each operation. 1 will provide a test program to you before the aay due date. Note: So Mta You can never have a date that is invalid. The only opportunity for this to happen will be with the overloaded constructor. Therefore if any invalid data is passed to this constructor, ignore all data and set the values to the default date. I have included an explanation of Julian dates. You can make your life much easier by using this formula. The example code is written in FORTRAN You will need to use "pass by reference" for some of the functions in the Julian date converter julionn fo myDate.spp file, H int Greg2Julian (int month, and return Julian number int day, int year): // pass in the Month, Day, Year Julian unck ton ind ffoid Julian2Greg (int JD, int & month, int & day, int & year): // pass in the op' fo reference Julian Date, and get the correct Month, Day and Year through the parameter list - pass by

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

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions