Question
LeapYear.cpp , which contains the following functionality Given the following rules, write a function that determines if a year is a leap year or not
LeapYear.cpp, which contains the following functionality
Given the following rules, write a function that determines if a year is a leap year or not (4 digit integer) and tell whether the given year is a leap year.
1) The function determines if a year is a leap year based on the criteria given below:
- There were no leap years before 1752.
- If the year divides by 400 then it is a leap year.
- All years that divide by 100 are not leap years.
- All years that divide by four are leap years. For example, 1800,1900 aren't leap years but 2000 will be; 1904, 1908,...,1996 were/will be leap years.)
2) If it is a leap year, the function adds it to an array that contains all the leap years within a specified range eg. 1700 - 2300
The file LeapYear.cpp must NOT contain a main() function.
Driver.cpp contains the main() function which:
1) Calls the functions in LeapYear.cpp and passes the range of years (1700 - 2300)
2) Gets a templated vector
Step 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