CS 115 Homework 5

50 Points

Due by Friday February 26, midnight

Submit your program with the Canvas Link.

Educational goals of this lab - verify that every student can

Preparations: Watch these videos

(50 points) Individual Problem: Leap Year Detection

Your program will ask the user for a range of years to check for leap years and print out all leapyears 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.

Sample run

Leap Year Detector

What is the start of the range? 1999
What is the end of the range? 2015

Leap Years in range 1999 to 2015

2000
2004
2008
2012

Sample run

Leap Year Detector

What is the start of the range? 1900
What is the end of the range? 2020

Leap Years in range 1900 to 2020

1904
1908
1912
1916
1920
1924
1928
1932
1936
1940
1944
1948
1952
1956
1960
1964
1968
1972
1976
1980
1984
1988
1992
1996
2000
2004
2008
2012
2016
2020

Sample run (with reversed start and stop values)

Leap Year Detector

What is the start of the range? 1975
What is the end of the range? 1950

Leap Years in range 1950 to 1975

1952
1956
1960
1964
1968
1972

(12 points) Test Plan

(12 points) Design

(26 points) Implementation

  • Submit your finished program with the Canvas link.