Write the definitions of the member functions of the class calendarType (designed in Programming Exercise 9) to implement the operations of the class calendarType. 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: (check the picture)This is exercise 9:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
  1. Write the definitions of the member functions of the class calendarType (designed in Programming Exercise 9) to implement the operations of the class calendarType.

  2. 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: (check the picture)This is exercise 9:

Using the classes extDateType (Programming Exercise 8) and dayType (Chapter 10, Programming Exercise 5), design the class calendarType so that, given the month and the year, we can print the calendar for that month. To print a monthly calendar, you must know the first day of the month and the number of days in that month. Thus, you must store the first day of the month, which is of the form dayType, and the month and the year of the calendar. Clearly, the month and the year can be stored in an object of the form extDateType by setting the day component of the date to 1 and the month and year as specified by the user. Thus, the class calendarType has two member variables: an object of the type dayType and an object of the type extDateType.

Design the class calendarType so that the program can print a calendar for any month starting January 1, 1500. Note that the day for January 1 of the year 1500 is a Monday. To calculate the first day of a month, you can add the appropriate days to Monday of January 1, 1500.

For the class calendarType, include the following operations:

  1. Determine the first day of the month for which the calendar will be printed. Call this operation firstDayOfMonth.

  2. Set the month.

  3. Set the year.

  4. Return the month.

  5. Return the year.

  6. Print the calendar for the particular month.

  7. Add the appropriate constructors to initialize the member variables.

September 2019
Sun
Mon
Tue
Wed
Thu
Fri
Sat
1
3
4
5
6
7
8.
10
11
12
13
14
15
16
18
19
20
21
22
23
24
25
26
27
28
29
30
m O7 4
2.
Transcribed Image Text:September 2019 Sun Mon Tue Wed Thu Fri Sat 1 3 4 5 6 7 8. 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30 m O7 4 2.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education