1. All years that are evenly divisible by 400 or are evenlydivisible by four (4)
ID: 3608954 • Letter: 1
Question
1. All years that are evenly divisible by 400 or are evenlydivisible by four (4) and notevenly divisible by 100 are leap years. For example, since 1600 isevenly divisible by
400, the year 1600 was a leap year. Similarly, since 1988 is evenlydivisible by four (4)
but not by 100, the year 1988 was also a leap year.
2. All months have either 31 days or 30 days, except Feb. that has28 days (non-leap
years) or 29 days (leap years).
3. Any day that is beyond the limit should be detected and theprogram requests a reentry.
Write a program to:
(1) Accept an integer for MONTH, an integer for the DAY of themonth, and an integer
for the year, and convert them into Months (January, February,…), Day, and Year
(if a leap year, informing the user on screen). If a number forMONTH or for DAY is out
of range, the program asks to re-enter the numbers.)
Output format:
(for input 11, 11, 2000) November 11, 2000. It is a leap year.
(for input 11, 11, 2001) November 11, 2001.
Explanation / Answer
please rate - thanks would have been easier/clearer with functions but don't know if youlearned them yet #include #include using namespace std; int main() { stringmth[12]={"January","February","March","April","May","June","July", "August","September","October","November","December"}; int days[12]={31,28,31,30,31,30,31,31,30,31,30,31}; int month, day, year,i,daysinmonth; bool good,leap,yeardone=false; do { good=false; coutmonth; if(month>0&&monthRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.