Could not identify a scenario where my program would fail. Please help? I have assumed the start of every hour is '00' minute and the program checks till '60' minutes. Could you please help if I have not created any scenario?
package com.codegym.task.task04.task0416;
/*
Crossing the road blindly
*/
import java.io.*;
public class Solution {
public static void signal(double a)
{
if (a > 5 && a < 60)
{
double b = a % 5;
if (b >= 1 && b <= 3)
{
System.out.println("green");
}
else
{
if (b > 3 && b <= 4)
{
System.out.println("yellow");
}
else
{
if (b > 4 && b <= 5)
{
System.out.println("red");
}
}
}
}
else
{
if (a >= 0 && a <= 3 )
{
System.out.println("green");
}
else
{
if (a > 3 && a <= 4)
{
System.out.println("yellow");
}
else
{
if (a > 4 && a <= 5)
{
System.out.println("red");
}
}
}
}
}
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
String i = bufferedReader.readLine();
double d = Double.parseDouble(i);
Solution.signal(d);
}
}