-
Lenguaje
Java usando Scanner
-
Descripción
Calcular el número de segundos contenidos en una determinada cantidad de horas solicitadas previamente.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import java.util.Scanner;
public class SegundosContenidosEnHoras {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int horas, segundos;
System.out.print("Ingresa el valor de horas: ");
horas = in.nextInt();
in.nextLine();
segundos=horas*60*60;
System.out.println("Valor de segundos: " + segundos);
}
}
public class SegundosContenidosEnHoras {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int horas, segundos;
System.out.print("Ingresa el valor de horas: ");
horas = in.nextInt();
in.nextLine();
segundos=horas*60*60;
System.out.println("Valor de segundos: " + segundos);
}
}