Question: Define a Date structure with day, month and year as its only integer members. Define a function - LeapYear ( ) - that takes an

Define a Date structure with day, month and year as its only integer members. Define a function - LeapYear()- that takes an integer for a year and returns true if the year is a leap year and false otherwise. Define a function - ValidDate()- that takes a Date argument and returns true if it's a valid date or false if it isn't, using LeapYear.
In main, declare a Date variable and an array of strings initialized to the names of the 12 months of the year: "January", "February", ... read a date from the user and store it in the date variable. Continue reading the date while it's not a valid date using the LeapYear() and ValidDate() functions.to check the year entered. Once a valid date has been entered, print the date in May 15,2021 format, using the array of months.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!