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

 

zbaharav@kehillah.org integer-operations > isLeap
prev  |  next  |  chance

In general, a year is a leap-year if it is divisible by 4. However, if it also divisible by 100 then it is not, UNLESS it is also divisible by 400, in which case it is. Write a method that takes a year as a parameter and decides if the year is a leap year or not, returning a boolean.


isLeap(16) → true
isLeap(100) → false
isLeap(800) → true

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

public 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: 210

Copyright Nick Parlante 2017 - privacy