Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone please help he with this. Its not compiling. Could someone please co

ID: 3584311 • Letter: C

Question

Can someone please help he with this. Its not compiling. Could someone please correct it, where it would work class Date{ private int date; private int month; private int year; public Date(){} public Date(int date,int month, int year){ this.date= date; this.month = month; this.year = year; } public void setDate(int date){ this.date = date; } public void setMonth(int month){ this.month = month; } public void setYear(int year){ this.year = year; } public int getDate(){ return date; } public int getMonth(){ return month; } public int getYear(){ return year; } public static boolean isLeapYear(int year) { if( year % 4 != 0 ){ return false; } if(( year % 400 != 0 ) && (year % 100 == 0)){ return false; }else{ return true; } } public static void main (String[] args){ int year = 0; String input = ""; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while(true){ System.out.println("Enter the year: "); try { input = in.readLine(); year = Integer.valueOf( input ).intValue(); } catch (IOException e) { e.printStackTrace(); } if(year < 0){break;} System.out.print ("Is it a leap year? "); System.out.println( isLeapYear(year) ); } } }

Explanation / Answer

You forgot to add import java.io.*;

here is complete compiling code for your problem

you can download it from here

http://pastie.org/5675064