Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Chapter 11 (8th edition: the book uploaded on the course page) Book page (813-815) Pdf page(863-865) Questions number (6,7,8,9,10) 6. In Programming Exercise 2, the

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Chapter 11 (8th edition: the book uploaded on the course page) Book page (813-815) Pdf page(863-865) Questions number (6,7,8,9,10) 6. In Programming Exercise 2, the class dateType was designed and implemented to keep track of a date, but it has very limited operations. Redefine the class dateType so that it can perform the following operations on a date, in addition to the operations already defined: a. Set the month. b. Set the day. c. Set the year. d. Return the month. e. Return the day. f. Return the year. g. Test whether the year is a leap year. h. Return the number of days in the month. For example, if the date is 3-12-2019, the number of days to be returned is 31 because there are 31 days in March. | Chapter 11: Inheritance and Composition i. Return the number of days passed in the year. For example, if the date is 3-18-2019, the number of days passed in the year is 77 . Note that the number of days returned also includes the current day. j. Return the number of days remaining in the year. For example, if the date is 3-18-2019, the number of days remaining in the year is 288 . k. Calculate the new date by adding a fixed number of days to the date. For example, if the date is 3-18-2019 and the days to be added are 25, the new date is 4-12-2019. 7. Write the definitions of the functions to implement the operations defined for the class dateType in Programming Exercise 6. 8. The class dateType defined in Programming Exercise 6 prints the date in numerical form. Some applications might require the date to be printed in another form, such as March 24, 2019. Derive the class extDateType so that the date can be printed in either form. Add a member variable to the class extDateType so that the month can also be stored in string form. Add a member function to output the month in the string format, followed by the year-for example, in the form March 2019. Write the definitions of the functions to implement the operations for the class extDateType. d. Return the month. e. Return the year. f. Print the calendar for the particular month. g. Add the appropriate constructors to initialize the member variables. 10. a. Write the definitions of the member functions of the class calendartype (designed in Programming Exercise 9) to implement the operations of the class calendarType. b. Write a test program to print the calendar for either a particular month or a particular year. For example, the calendar for September 2019 is

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

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students also viewed these Databases questions

Question

What roles have these individuals played in your life?

Answered: 1 week ago

Question

1. Write down two or three of your greatest strengths.

Answered: 1 week ago