Выводит ерунду какую-то. Почему?
java.lang.NumberFormatException: For input string: "2.5"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at com.javarush.task.task04.task0416.Solution.main(Solution.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
package com.javarush.task.task04.task0416;
/*
Переходим дорогу вслепую
*/
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
public class Solution
{
public static void main(String[] args) throws Exception
{
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
String a = reader.readLine();
double t = Integer.parseInt(a);
if (t >= 1.0 && t < 3.0)
System.out.println("зелёный");
if (t >= 3.0 && t < 4.0)
System.out.println("жёлтый");
if (t >= 4.0 && t < 5.0)
System.out.println("красный");
}
}