-
Lenguaje
Java usando Scanner
-
Descripción
Pedirá al usauario la nota recibida en un examen por alumno/a, y deberá mostrar un texto que recoja la nota, de la sigiente forma.
Nota entre 0 y 2 -> Muy deficiente
Nota entre 2.1 y 4.9 -> Insuficiente
Nota entre 5.0 y 6.9 -> Suficiente
Nota entre 7.0 y 8.9 -> Notable
Nota mayor de 9 -> Sobresaliente
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.Scanner;
public class NotaEnTexto {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double nota;
System.out.print("Ingresa el valor de nota: ");
nota = in.nextDouble();
in.nextLine();
if(nota>=0&¬a<2.1)
System.out.println("Muy deficiente");
if(nota>=2.1&¬a<5)
System.out.println("Insuficiente");
if(nota>=5&¬a<7)
System.out.println("Suficiente");
if(nota>=7&¬a<9)
System.out.println("Notable");
if(nota>=9)
System.out.println("Sobresaliente");
}
}
public class NotaEnTexto {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double nota;
System.out.print("Ingresa el valor de nota: ");
nota = in.nextDouble();
in.nextLine();
if(nota>=0&¬a<2.1)
System.out.println("Muy deficiente");
if(nota>=2.1&¬a<5)
System.out.println("Insuficiente");
if(nota>=5&¬a<7)
System.out.println("Suficiente");
if(nota>=7&¬a<9)
System.out.println("Notable");
if(nota>=9)
System.out.println("Sobresaliente");
}
}