public class Solution {
public static void main(String[] args) {
//write your code here
convertEurToUsd(5,1.400);
convertEurToUsd(60000,20.9);
System.out.println(convertEurToUsd());
System.out.println(convertEurToUsd());
}
public static double convertEurToUsd(int eur, double exchangeRate) {
//write your code here
double dollar = eur * exchangeRate;
return dollar;
}
}
Why it's not working? it seems very simple
Resolved
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
28 May 2019, 20:11
Don't know what task you are on. Next time make sure to ask the question by hitting the help button on the task and not on the side bar. Also don't copy + paste code, when you ask it from a task you can use the slider to attach the code:
.
.
![]()

0
Guadalupe Gagnon
28 May 2019, 20:15
without knowing what task you are on, both of these lines are going to throw errors and cause your code not to work:
This is because you are not passing any valued to the method convertEurToUsd(), but it requires an int and a double. Does the task ask for that method to print information, or the main method? your print lines are in the main method so i will assume that is the answer. Take both of these lines:
and copy them into the print lines methods to replace the bad code. That will get your code to compile. Without knowing the task objectives I don't know if you are going to pass with that though. 0
Adrian George Teodorescu
28 May 2019, 20:51
Thank you very much for your answer!
0