[Solved]Ect 11 Restrictions C Technique Covered Chapters 1 12 Allowed Except Gobal Variables 11 De Q37181316
C++



ect 11 Restrictions Any C+ technique covered in Chapters 1 through 12 is allowed except for gobal variables 11 Descri For this project a Date class will be constructed (contained in the file P11.h) and all function definitions will be written in the file Project 11.cpp. A makefile is provided to compile this project. The source code containing the main function is provided as well. Name of this file is Project 11main.cpp. On Canvas, download the files P11.h, Project 11 main.cpp and Makefile. Save these files in your Project 11 directory. Do not modity these files. Another file is provided as well. It is Project 11.cpp. Download this and all the code you write will be in this file. This file contains all the function definitions for the methods described in the class in the header file provided. This project is similar to the Time class described in the classes power point slides Note: do not use any variable/parameter in your functions or program that are named month, day or year -these are used as private members of the class and you want make sure that you know which variable or parameter you are talking about. For this project the fol owing functions are written: 1) For class constructors: A default constructor called Date0-default date is 1/11900 A parameterized constructor Date(int, int, int)-initialize a Date object to the values provided when it is declaredfi.e. Date myDate 1,1,1900); a. b. 2) For the class Transformers a. A parameterized function SetDate int.int.int)- this sets the date in a Date object variable of the cass Type Date) to the date specified 3) For the class observers-two functions for writing out the date one format is all numbers the other requires the use of the month name and one function for comparing two dates. a. WriteNumberFormat0 writes out the date in format MMWDDYYYY Page 1 of 3 b. WriteNameFormato writes out the date in format MonthName day, year c. SameDate(Date) retums true or false if the class object invoking the function is the same date as the cass object passed in as a parameter After downloading all 4 files (P11h, Makefile, Project 11 main.cpp and Project 11.cpp), start your work by making empty function stubs in Project 11.cpp. The function headings are determined from the public functions isted in P11.h. Once you have all the function stubs written, you should be able to run the Makefe (type make at the command prompt) to generate the program executable Project 11. You can run the program, but not much happens. Now add code to each of the functions described above and after completing each function, run the makefile to make sure the program stil compiles. If it does not compile fix the errors until it does compie. recommend writing the two constructors and WriteNumberFormat functions first. Then the rest of the functions can be written in any order Project 11 Function Contents 1) The constructor functions set the private members of month, day and year to the default values or the values specified. The order for the Parameterized constructor is Month, Day and Year 2) The SetDate function takes in a date -order is Month, Day and Year- and stores those values in the appropriate private members 3) The Write NumberFormat function takes the values of the private members month, day and year and outputs them in the form mm/dd/yyyy 4) The WriteNameFormat function uses the values of the private members month, day and year and outputs them in MonthName day, year format. To get the month name, use a switch statement using month as the switch expression and the enumerators provided in the header fie as the case labels. 5) The SameDate function compares the private members month, day and year of the object that invokes the function with the month, day and year members of the object supplied as the argument in the function call Boolean true is returned if the dates are identical and false is returned otherwise. When completed, the program output shall match that of the sample solution. There are no input files for this program. All input operations are run from Project 11_main.cpp. Output that does not match that of the sample solution will lose points. All of these functions are relatively short (less than 10 lines) except for the WriteNameFormat function that has several lines due to the 12 case label switch statement unless you want to an array and store the month names in an array and then aocess the correct array el for the name just remember the month numbers are 1 through 12 and array indexing starts at 0. Project 11 Helpful Information To output days or months less than 10 with a leading 0, use cout << setfilland Write one function and then run the Makefile by typing make on the command line. Fix all errors in the function before moving on to the next function There is very little in the way of output statements in the functions. Matter of fact, only the two write functions have output statements in them. All other output is handled in main which is provided and should not be changed Show transcribed image text ect 11 Restrictions Any C+ technique covered in Chapters 1 through 12 is allowed except for gobal variables 11 Descri For this project a Date class will be constructed (contained in the file P11.h) and all function definitions will be written in the file Project 11.cpp. A makefile is provided to compile this project. The source code containing the main function is provided as well. Name of this file is Project 11main.cpp. On Canvas, download the files P11.h, Project 11 main.cpp and Makefile. Save these files in your Project 11 directory. Do not modity these files. Another file is provided as well. It is Project 11.cpp. Download this and all the code you write will be in this file. This file contains all the function definitions for the methods described in the class in the header file provided. This project is similar to the Time class described in the classes power point slides Note: do not use any variable/parameter in your functions or program that are named month, day or year -these are used as private members of the class and you want make sure that you know which variable or parameter you are talking about. For this project the fol owing functions are written: 1) For class constructors: A default constructor called Date0-default date is 1/11900 A parameterized constructor Date(int, int, int)-initialize a Date object to the values provided when it is declaredfi.e. Date myDate 1,1,1900); a. b. 2) For the class Transformers a. A parameterized function SetDate int.int.int)- this sets the date in a Date object variable of the cass Type Date) to the date specified 3) For the class observers-two functions for writing out the date one format is all numbers the other requires the use of the month name and one function for comparing two dates. a. WriteNumberFormat0 writes out the date in format MMWDDYYYY Page 1 of 3
b. WriteNameFormato writes out the date in format MonthName day, year c. SameDate(Date) retums true or false if the class object invoking the function is the same date as the cass object passed in as a parameter After downloading all 4 files (P11h, Makefile, Project 11 main.cpp and Project 11.cpp), start your work by making empty function stubs in Project 11.cpp. The function headings are determined from the public functions isted in P11.h. Once you have all the function stubs written, you should be able to run the Makefe (type make at the command prompt) to generate the program executable Project 11. You can run the program, but not much happens. Now add code to each of the functions described above and after completing each function, run the makefile to make sure the program stil compiles. If it does not compile fix the errors until it does compie. recommend writing the two constructors and WriteNumberFormat functions first. Then the rest of the functions can be written in any order Project 11 Function Contents 1) The constructor functions set the private members of month, day and year to the default values or the values specified. The order for the Parameterized constructor is Month, Day and Year 2) The SetDate function takes in a date -order is Month, Day and Year- and stores those values in the appropriate private members 3) The Write NumberFormat function takes the values of the private members month, day and year and outputs them in the form mm/dd/yyyy 4) The WriteNameFormat function uses the values of the private members month, day and year and outputs them in MonthName day, year format. To get the month name, use a switch statement using month as the switch expression and the enumerators provided in the header fie as the case labels. 5) The SameDate function compares the private members month, day and year of the object that invokes the function with the month, day and year members of the object supplied as the argument in the function call Boolean true is returned if the dates are identical and false is returned otherwise. When completed, the program output shall match that of the sample solution. There are no input files for this program. All input operations are run from Project 11_main.cpp. Output that does not match that of the sample solution will lose points. All of these functions are relatively short (less than 10 lines) except for the WriteNameFormat function that has several lines due to the 12 case label switch statement unless you want to an array and store the month names in an array and then aocess the correct array el for the name just remember the month numbers are 1 through 12 and array indexing starts at 0.
Project 11 Helpful Information To output days or months less than 10 with a leading 0, use cout
Expert Answer
Answer to ect 11 Restrictions Any C+ technique covered in Chapters 1 through 12 is allowed except for gobal variables 11 Descri Fo… . . .
OR

