Hello,
Can anyone help me determine why my code will not satisfy the requirements? I have copied the same code into Coolbeans and I have entered every number 1-60 and every number gives the correct output. What am I doing wrong?
Thank you!
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 sc = new Scanner(System.in);
double t = sc.nextDouble();
if (t%5 >0 && t%5 <=3){
System.out.println("green");
}
else if (t%5 >=3 && t%5 <=5){
System.out.println("yellow");
}
else
System.out.println("red");
}
}