Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that takes a year as input to determine whether the year is a leap year or not. (Hint: Use the % (modulus)

image text in transcribed

Write a program that takes a year as input to determine whether the year is a leap year or not. (Hint: Use the % (modulus) operator) We know that in a leap year, the year has 366 days and the February is 29 days. It comes every 4 years. In a program you have to check the following to determine whether the year is a leap year or not: A year is a leap year if the following conditions are satisfied: 1. Year is multiple of 400. 2. Year is multiple of 4 and not multiple of 100. This means that in the Gregorian calendar, the years 2000 and 2400 are leap years, while 1800, 1900, 2100, 2200, 2300 and 2500 are NOT leap years. Sample input #1 Enter a year: 2020 2020 is a leap year. Sample input #2 Enter a year: 1800 1800 is not a leap year. (Note that it will not be graded). This is hypothetical Rubric: 2 point Taking input: 0.10 Displaying correct leap year for the test cases 90 Displaying correct not leap year for the test cases: 90 Writing good code: 0.10 Additional note: 20% penalty for not passing mimir test cases, even if your program shows the correct result. Hard coding to match mimir test cases will result in zero in this submission and zero in another submission

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

7. Discuss the key features of the learning organization.

Answered: 1 week ago