forked from kant003/JavaPracticeHacktoberfest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGabrielRomero.java
More file actions
37 lines (26 loc) · 713 Bytes
/
GabrielRomero.java
File metadata and controls
37 lines (26 loc) · 713 Bytes
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
import java.util.Scanner;
public class GabrielRomero {
//1 euro = 0,96 dolares
public static double euroADolar(double e) {
double temp=0;
temp = e*0.96 ;
return temp;
}
//1 dolar= 1,05 euros
public static double dolarAEuro(double d) {
double temp=0;
temp = d*1.05;
return temp;
}
public static void main(String[] args) {
double aux;
Scanner sc = new Scanner(System.in);
System.out.println("por favor introduzca euros: ");
aux=sc.nextDouble();
System.out.println("en dolares son: "+euroADolar(aux));
System.out.println("por favor introduzca dolares: ");
aux=sc.nextDouble();
System.out.println("en euros son: "+dolarAEuro(aux));
sc.close();
}
}