Question: Rules: A year is a leap year if it is evenly divisible by 4, unless it is divisible by 100, in which case it must
Rules: A year is a leap year if it is evenly divisible by 4, unless it is divisible by 100, in which case it must also be divisible by 400. Examples: 1996 is a leap year because it is divisible by 4 and not 100. 1997 is not a leap year because it is not divisible by 4. 2000 is a leap year because it is divisible by 100 and 400. 2100 will not be a leap year because it is divisible by 100 but not 400. Your program will ask the user for a range of years to check for leap years and print out all leap years in that range. The range should be inclusive, including both endpoints given. If the numbers are given in reverse order, your program can reverse them.
Test Plan Any integer can be a test case input. You need to make sure you have tested some numbers in each of the categories, "not divisible by 4", "divisible by 4 but not 100", etc. Go to this web page Links to an external site. for a leap year calculator to check the answers you worked out. Give a list of 4 test cases in a comment at the bottom of your program. They should have all the information in a test plan, as we have used all semester. So you have to provide the description of what you are testing, input to test that, expected output for each test case.
Design Write the usual 3 P's for your prolog. Describe what your control structures (loops and if's) are doing. A comment for each loop and if is sufficient.
Implementation Write a program which will ask the user for start and stop values of the range of years they want checked for leap years. If the start value is greater than the stop value, swap the values of the variables. Use a for loop for that range. Make sure the loop runs through the entire range including the last one given by the user. The logic for determining if a number is a leap year can be written with nested if's or with boolean operators (and, or, not).
in python please
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
