-
Notifications
You must be signed in to change notification settings - Fork 0
/
capturandoDatos
93 lines (72 loc) · 2.41 KB
/
capturandoDatos
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package matrices;
import java.util.Scanner;
public class Matrices {
public static void suma(){
int n1,n2;
Scanner sc = new Scanner(System.in);
double ans;
System.out.print("Ingrese el primer numero: ");
n1 = sc.nextInt();
System.out.print("Ingrese el segundo numero: ");
n2 = sc.nextInt();
sc.close();
ans = n1 + n2;
System.out.println("La suma de: " + n1 + " y " + n2 + " = " + ans);
}
public static void resta(){
int n1,n2;
Scanner sc = new Scanner(System.in);
double ans;
System.out.print("Ingrese el primer numero: ");
n1 = sc.nextInt();
System.out.print("Ingrese el segundo numero: ");
n2 = sc.nextInt();
sc.close();
ans = n1 - n2;
System.out.println("La suma de: " + n1 + " y " + n2 + " = " + ans);
}
public static void division(){
int n1,n2;
Scanner sc = new Scanner(System.in);
double ans;
System.out.print("Ingrese el primer numero: ");
n1 = sc.nextInt();
System.out.print("Ingrese el segundo numero: ");
n2 = sc.nextInt();
sc.close();
ans = n1 / n2;
System.out.println("La division de: " + n1 + " y " + n2 + " = " + ans);
}
public static void multiplica(){
int n1,n2;
Scanner sc = new Scanner(System.in);
double ans;
System.out.print("Ingrese el primer numero: ");
n1 = sc.nextInt();
System.out.print("Ingrese el segundo numero: ");
n2 = sc.nextInt();
sc.close();
ans = n1 * n2;
System.out.println("La multiplica de: " + n1 + " y " + n2 + " = " + ans);
}
public static void castVar(){
String sn1 = "25";
String sn2 = "25";
int n1 = Integer.valueOf(sn1);
int n2 = Integer.valueOf(sn2);
System.out.println(n1+n2);
}
public static void main(String[] args) {
Scanner reco = new Scanner(System.in);
System.out.println("Cual es tu nombre");
String nombre = reco.nextLine();
System.out.println("Cual es tu altura");
double altura = reco.nextDouble();
System.out.println("Buen dia " + nombre + " Bro, tu altura es: " + altura);
castVar();
//suma();
//resta();
//division();
//multiplica();
}
}