Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please do in C++, HOMEWORK #16-Calendar Program Write a program to print the calendar for a particular month or a particular year. For example, the
Please do in C++,
HOMEWORK #16-Calendar Program Write a program to print the calendar for a particular month or a particular year. For example, the : calendar for February 2017 is Feburary 201'7 SunMon Tue Wed Thu Fri Sat 2 12 19 26 13 20 27 14 21 28 10 17 24 15 16 23 18 25 Specifications: To solve this problem, you will create a number of classes using inheritance and composition In Chapter 11 of Malik's book, he uses a class called dateType (see pages 774-776), which is designed to store the month, day, and year for calendar dates. Use the dateType class as the initial basis for your program. The class uses the following public and private members Public: void setDate (int month, int day, int year); int getDay) consti int getMonth () const; int getYear) const void printDate () const; dateType (int month-1, int day-l, int year-1900) Private int dMonth; int dDay int dYear; Create the class, and copy the definitions of the class member functions into an appropriate .cpp file. Next, modify the definitions of the function setDate () and the constructor so that the values for the month, day, and year are checked before storing the date into the member variables. If an incorrect month, day, or year is used, use the default values of 1, 1, and 1900 respectively. Add a new public member function, isLeapYear ), to check weather a year is a leap year. HOMEWORK #16-Calendar Program Write a program to print the calendar for a particular month or a particular year. For example, the : calendar for February 2017 is Feburary 201'7 SunMon Tue Wed Thu Fri Sat 2 12 19 26 13 20 27 14 21 28 10 17 24 15 16 23 18 25 Specifications: To solve this problem, you will create a number of classes using inheritance and composition In Chapter 11 of Malik's book, he uses a class called dateType (see pages 774-776), which is designed to store the month, day, and year for calendar dates. Use the dateType class as the initial basis for your program. The class uses the following public and private members Public: void setDate (int month, int day, int year); int getDay) consti int getMonth () const; int getYear) const void printDate () const; dateType (int month-1, int day-l, int year-1900) Private int dMonth; int dDay int dYear; Create the class, and copy the definitions of the class member functions into an appropriate .cpp file. Next, modify the definitions of the function setDate () and the constructor so that the values for the month, day, and year are checked before storing the date into the member variables. If an incorrect month, day, or year is used, use the default values of 1, 1, and 1900 respectively. Add a new public member function, isLeapYear ), to check weather a year is a leap yearStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started