As the condition says
Number of days in the year: x
, where
x is 366 for a leap year, and
x is 365 for an ordinary year.
I think the CORRECT output line of code like this -->System.out.println(Number of days in the year: x).
it should NOT be like as I've done on line 18 & 21.
Intelli J Idea ISSUE : This is with the reference variable stryr (in ide it is underlined green) on line 14. when i move cursor over this in IDE it shows Typo: in word stryr
Why it is so?
And more thing what does this yellow bulb indicates in IDE if everything is fine.
package com.codegym.task.task04.task0414;
/*
Number of days in the year
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String stryr= reader.readLine();
int yr = Integer.parseInt(stryr);
if (yr%400==0 && yr%100==0 && yr%4==0 )
System.out.println("Number of days in the year: 366 ");
else
System.out.println("Number of days in the year: 365");
}
}