Ayuda con JAVA
Publicado por Antonio Manuel (1 intervención) el 08/12/2017 18:30:02
Buenas, es la primera vez que escribo en este foro, soy estudiante de programación y estoy compilando un programa que te identifica si un numero mayor de cero es positivo par o impar y si es menor de cero negrativo par o impar. El código sería el siguiente:
Estos son los errores que me salen:
Exception in thread "main" java.lang.UnsupportedOperationException: Not supported yet.
at ed_tarea.Scanner.<init>(Scanner.java:17)
at ed_tarea.ED_Tarea.main(ED_Tarea.java:18)
C:\Users\herra\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)
Os agradecería muchísimo que me pudierais ayudar.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package ed_tarea;
/**
*
* @author herra
*/
public class ED_Tarea {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.nextlnt();
if (a>0)
if (a%2==0)
System.out.println(a+"es positivo y par");
else
System.out.println(a+"es positivo e impar");
else if (a<0)
if (a%2==0)
System.out.println(a+"es negativo y par");
System.out.println(a+"es negativo e impar");
if(a==0)
System.out.println(a+"es cero");
}
Estos son los errores que me salen:
Exception in thread "main" java.lang.UnsupportedOperationException: Not supported yet.
at ed_tarea.Scanner.<init>(Scanner.java:17)
at ed_tarea.ED_Tarea.main(ED_Tarea.java:18)
C:\Users\herra\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)
Os agradecería muchísimo que me pudierais ayudar.
Valora esta pregunta


0