Question: Lab 3 A year with 366 days is called a leap year. A year is a leap year if it is divisible by four (for

 Lab 3 A year with 366 days is called a leap

Lab 3 A year with 366 days is called a leap year. A year is a leap year if it is divisible by four (for example, 1980 is a leap year), except that it is not a leap year if it is divisible by 100 (for example, 1900 is not a leap year); however, it is a leap year if it is divisible by 400 (for example, 2000 is a leap year). There were no exceptions before the introduction of the Gregorian calendar on October 15, 1582. In other words, the pre-Gregorian (Julian) calendar considered the year 1500 a leap year even though it should not have been due to the fact that calculations of the Earth's orbit around the sun were slightly over (a small error, no doubt) by approximately 11 minutes every year. In 1582, that error was fixed. The year 1582 was not a leap year since 1582 is not divisible by 4. Write a program that asks the user for a year and determines whether that year is a leap year. Your program should contain a single if statement. Exercise 3 Modify the Lab 3 program so that it takes as input the following file contents (input.txt): 1600 1240 1890 2650 2020 Create this file on your own. The results should be redirected into an output file (output.txt)

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!