Question: C++ using iostream and namespace std Write a function called checkLeapYear that takes a single integer argument representing a year and returns true if it

C++ using iostream and namespace std

C++ using iostream and namespace std Write a function called checkLeapYear that

Write a function called checkLeapYear that takes a single integer argument representing a year and returns true if it is a leap year and false otherwise. This function MUST use a single if statement and Boolean operators. Your function MUST be named checkleapYear Your function should take one parameter: the year value, as a positive integer Your function only uses if. else cannot be used to solve this problem Your function should return a boolean value, true or false, according to the leap year definition (see below) What is a leap year? In general, years divisible by 4 are leap years. For dates after 1582, however, there is a Gregorian correction. Years divisible by 100 are not leap years but years divisible by 400 are. So, for instance, 1900 was not a leap year but 2000 was. Examples: When the argument is equal to 1900, the function should return folse; When the argument is equal to 2000, the function should return true For example: Test int year 1616; Result 1616 is a leap year. bool leap checkLeaprear(1616); int year 1981; 1981 is not a leap year bool leap checkLeapYear (1981)

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 Databases Questions!