• Lenguaje

    Java usando Scanner

  • Descripción

    Leer las notas de una clase de informática y deducir todas aquellas que son NOTABLES (>= 14 y < 18).

1
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 NotasNotables {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        double nota;
        String tecla_repetir;
        do {
            System.out.print("Ingresa el valor de nota: ");
            nota = in.nextDouble();
            in.nextLine();
            if(nota>=14&&nota<18)
                System.out.println("Notable");
            System.out.println();
            do {
                System.out.print("\u00BFDeseas repetir el proceso? (S/N): ");
                tecla_repetir = in.nextLine();
            } while (!tecla_repetir.equalsIgnoreCase("s") && !tecla_repetir.equalsIgnoreCase("n"));
        } while (tecla_repetir.equalsIgnoreCase("s"));
    }

}