id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

norm.krumpe@muohio.edu leapyear > isLeap
prev  |  next  |  chance

Years that are divisible by 4 are leap years, but with some exceptions: any year divisible by 100 is NOT a leap year, unless it is also divisible by 400. Write a method that returns true if a given year is a leap year, and false otherwise. CHALLENGE: Write this with a return statement and no "if" statements.


isLeap(2024) → true
isLeap(2013) → false
isLeap(2500) → false

...Save, Compile, Run (ctrl-enter)

boolean isLeap(int year) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100

Copyright Nick Parlante 2017 - privacy