Switched to the modulo but the system won't verify the yellow. Any ideas why? When I put numbers to get yellow it shows yellow.
package com.codegym.task.task04.task0416;
/*
Crossing the road blindly
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
Scanner scan = new Scanner(System.in);
double t = scan.nextDouble();
t = t % 5;
if (t == 0 && t <= 2.9){
System.out.println("green");
}
else if (t >= 3.0 && t <= 3.9){
System.out.println("yellow");
}
else if(t >= 4.0 && t <= 5.0){
System.out.println("red");
}
else System.out.println("green");
}
}