I tried all kind of real numbers and the program works correctly.. can any one spot an issue?
package com.codegym.task.task04.task0416;
/*
Crossing the road blindly
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
String NumStr = rd.readLine();
double Num = Double.parseDouble(NumStr);
if( Num % 5.0 >= 0.001 && Num % 5 <= 3){
System.out.println("green");
}
else if(Num % 5.0 > 3 && Num % 5 <= 4){
System.out.println("yellow");
}
else{
System.out.println("red");
}
}
}