Question: Write a program that prints the next x leap years that occur in the open interval [ 2020, ). Pseudocode PROGRAM INPUT x? ,x c
Write a program that prints the next x leap years that occur in the open interval [ 2020, ). Pseudocode PROGRAM INPUT "x? ",x c := ______ year := 2020 DO IF ( IsLeapYear(year) ) THEN PRINT year,ENDL c := c+1 END year := year+1 WHILE ( c ___ x ) STOP END //--------------------------------------------------------------- FUNCTION IsLeapYear(IN year: int): boolean //--------------------------------------------------------------- Every year that is exactly divisible by 4 is a leap year, except for years that are exactly divisible by 100, but these centurial years are leap years if they are exactly divisible by 400. For example, the years 1700, 1800, and 1900 were not leap years, but the years 1600 and 2000 were. Taken from https://en.wikipedia.org/wiki/Leap_year January 15, 2018 END
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
