In general terms the algorithm for calculating a leap year is as follows...
A year will be a leap year if it is divisible by 4 but not by 100. If a year is divisible by 4 and by 100, it is not a leap year unless it is also divisible by 400.
Thus years such as 1996, 1992, 1988 and so on are leap years because they are divisible by 4 but not by 100. For century years, the 400 rule is important. Thus, century years 1900, 1800 and 1700 while all still divisible by 4 are also exactly divisible by 100. As they are not further divisible by 400, they are not leap years.
Write a program that asks the user how many years they want to check.
For that number of times the program accepts as data a year. The program will then determine if the year is a leap year or not. The program will keep doing this until the correct number of years is checked.
Display the percentage of input years that are leap years, as well as the percentage that are not leap years. Confirm these add to 100.
Use a sentinel instead of asking how much data you have
using formatting as described in the text, make a table of your output. Real numbers should have 2 decimal places, and decimal points should line up
can you put the comments on each code for what they do. Thank you if you can help me