Question

For this project a Date class(specifiedin the file Project_10.h) will be constructed and all function definitions will be written in the file Project_10.cpp. A makefileis provided to compile this project. The file Project_10_main.cppcontainsthe main fun

Project_10_base_files.zip

Makefile (2).txt

Project_10_main 1.JPG

Project_10_main 2.JPG

Project_10_main 3.JPG

Project_10 h.JPG

Project_10 cpp.JPG


Any C++ technique covered in Chapters 1 through 12is allowedexcept for global variablesYou are not allowed to use any global variables.If necessary, global constants may be used.Project 10DescriptionFor this project a Date class(specifiedin the file Project_10.h) will be constructed and all function definitions will be written in the file Project_10.cpp.  A makefileis provided to compile this project.  The file Project_10_main.cppcontainsthe main functionthat is used to run the program.On Canvas, download the files Project_10.h, Project_10_main.cpp and Makefile. Save these files in your Project 10directory.  Do not modify these files.Another file is provided as well.It is Project_10.cpp. Download this and all the code you write will be in this file.This file contains all the function definitions for the methods for theclass specification provided in the header file Project_10.hThis project is similar to the Time class described in the classes power point slides and goine over in classNote: do not use any variable/parameter in your functions or program that are named month, day or year these are used as private membersof the class and you wanttomake sure that you know which variable or parameter you are talking about.  For this project the following functions are written:1)For class constructors:a.A default constructor called Date() default date is 1/1/1900b.A parameterized constructor Date(intmonth, intday, intyear) initialize a Date object to the values provided when it is declared(i.e. Date myDate(1,1,1900);) c.A parameterized constructor Date(int month,int year) initialize a Date object with the two values provided and sets the day value to 1.2)For the class Transformersa.A parameterized function SetDate(int,int,int) this sets thedate in a Date object (instance/variableof the class Type Date) to the date specifiedb.A function toincrement the date by 1 day

Spring 2021CPE211Project AssignmentProject 10Page 2of 33)For the class observers two functionsfor writing out the date one format is all numbers the other requires the use of the month name and threefunctionsfor comparing two dates.a.WriteNumberFormat() writes out the date in format MM/DD/YYYYb.WriteNameFormat() writes out the date in format  MonthName day, yearc.SameDate(Date) returns trueif the class object invoking the function is the same date ofthe classobject passed in as an argument and returns false otherwised.BeforeDate(Date) returns trueif the class object invoking the function is before the date ofthe class object passed in as an argument and returns false otherwisee.AfterDate(Date) returns trueif the class object invoking the function is after  the date ofthe classobject passed in as an argument and false otherwiseAfterdownloadingall 4 files (Project_10.h, Makefile, Project_10_main.cpp and Project_10.cpp), start your work by making empty function stubs in Project_10.cpp.  The function headings are determined from thepublicfunctions listed in Project_10.h.  Once you have all the function stubs written, you should be able to run the Makefile(type make at the command prompt)to generate the program executable Project_10.  You can run the program, but not much happens.Now add code to each ofthe functions described above and after completing each function, run the makefile to make sure the program still compiles.  If it does not compile fix the errors until it does compile.  I recommend writing the two constructors and WriteNumberFormat functions first.Then the rest of the functions can be written in any order.Project 10Function Contents1)The constructor functionsset the private members of month, day and year to the default values or the values specified.  The order for the 3 parameter Parameterized constructor is Month, Day and Year.  The order for the 2 parameter Parameterized constructor is Month, Year and the day is set to 1.2)The SetDatefunction takes in a date order is Month, Day and Year and stores those values in the appropriate private members3)The IncrementDatefunction increments the date of the object by one day.  This function will have to make a test for when a new month is moved into and when a new year is moved into because of the increment.  Using a switch statement based on the month of the current date simplifies the work necessary for cases where a new month or year is entered due to the increment of 1 day.  Do not worry about leap yearsassume February always has 28 days. Lots of ways to perform the increment action4)The WriteNumberFormatfunction takes the values of the private members month, day and year and outputs them in the form mm/dd/yyyy.  If needed, Leading 0s are required


0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
For this project a Date class(specifiedin the file Project_10.h) will be constructed and all function definitions will be written in the file Project_10.cpp. A makefileis provided to compile this project. The file Project_10_main.cppcontainsthe main fun
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT