public static void main(String[] args) {
//write your code here
System.out.println(convertEurToUsd(45));
System.out.println(convertEurToUsd(34));
}
public static double convertEurToUsd(int eur, double exchangeRate) {
//write your code here
double usd = eur * exchangeRate;
return usd;
can someone give me a hint on how to display the result twice
Under discussion
Comments (14)
- Popular
- New
- Old
You must be signed in to leave a comment
Нур
1 February 2019, 16:05
public class Solution {
public static void main(String[] args) {
System.out.println(convertEurToUsd(12, 12.3));
System.out.println(convertEurToUsd(32, 34.4));
}
public static double convertEurToUsd(int eur, double exchangeRate) {
double x = (eur*exchangeRate);
return x;
}
}
0
andrew
22 January 2019, 12:00
i think you have to define the exchange rate.
System.out.println(convertEurToUsd(45, 1.5));
System.out.println(convertEurToUsd(34, 1.5));
0
Dyranz
28 December 2018, 14:29
package com.codegym.task.task03.task0303;
/*
Currency exchange
*/
public class Solution {
public static void main(String[] args) {
//write your code here
//convertEurToUsd (5, 13.6);
//convertEurToUsd (6, 12.6);
System.out.println(convertEurToUsd (1, 1.15));
System.out.println(convertEurToUsd (5, 5.75));
}
public static double convertEurToUsd(int eur, double exchangeRate)
{
//write your code here
double currency =eur * exchangeRate;
return currency;
}
0
Vadym
25 December 2018, 15:14
public class Solution {
public static void main(String[] args) {
//write your code here
System.out.println(convertEurToUsd(50,40));
System.out.println(convertEurToUsd(40,50));
}
public static double convertEurToUsd(int eur, double exchangeRate) {
//write your code here
double exhangeDollars = eur * exchangeRate;
return exhangeDollars;
}
}
0
srivani
24 August 2018, 05:10
we can print twice or use for loop....
0
yanzy050
24 August 2018, 08:46
this what my problem is
public static void main(String[] args) {
//write your code here
System.out.println(convertEurToUsd(45));
System.out.println(convertEurToUsd(34));
}
public static double convertEurToUsd(int eur, double exchangeRate) {
//write your code here
double usd = eur * exchangeRate;
return usd;
0
KryptoBlack
25 August 2018, 15:04useful
The method convertEurToUsd is asking for 2 arguments while you are giving it only 1.
You need to give it the value of eur and excangeRate
+3
yanzy050
26 August 2018, 12:52
i really don't understand, that 45 and 34? is not a value?
can you explain to me everything?
0
Roman
27 August 2018, 10:10
The method convertEurToUsd is asking for 2 arguments while you are giving it only 1.
For example
+2
KryptoBlack
14 October 2018, 10:22
The above method "convertEurToUsd" requires two arguments to work namely "int eur" and "double exchangeRate".
But,
You have only provided one argument/parameter to the method while calling insted of two so thats why java is trying to find a method with one argument which obviously is not there in your code.
Try something like this,
0
yanzy050
24 August 2018, 03:49
help please i'm stock
0
Artem Divertitto Senior Android Developer at United Tech
23 August 2018, 13:58
U can try
0
yanzy050
23 August 2018, 14:46
it didn't work,
System.out.println(convertEurToUsd(50));
System.out.println(convertEurToUsd(20));
}
public static double convertEurToUsd(int eur, double exchangeRate) {
//write your code here
double usd = eur * exchangeRate;
return usd;
0
prasanth
12 December 2018, 05:47
public class Solution {
public static void main(String[] args) {
double a = convertEurToUsd(50,2);
double b = convertEurToUsd(111,6);
System.out.println(a);
System.out.println(b);
}
public static double convertEurToUsd(int eur, double exchangeRate) {
double result = eur * exchangeRate;
return result;
}
}
+1