package com.codegym.task.task03.task0303;
/*
Currency exchange
*/
public class Solution {
public static void main(String[] args) {
//write your code here
convertEurToUsd(1400,1.5) ;
System.out.println(convertEurToUsd(1400,1.5)) ;
convertEurToUsd(105.6 ,1.8);
System.out.print(convertEurToUsd(105.6,1.8)) ;
}
public static double convertEurToUsd(int eur, double exchangeRate) {
//write your code here
double dollar=eur*exchangeRate;
return dollar;
}
public static double convertEurToUsd(double eur,double exchangeRate) {
double dollar = eur*exchangeRate;
return dollar;
}
}
please help me...I can't find the answer ,stuck with the third requirement...
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Cz Ferencz
19 November 2019, 15:40
105.6 is not an int, but a double. Maybe there's your problem. Or at least part of it. Hope this helps. eur should be an int, not a double.
0
Marina Ivanova
16 November 2019, 16:46
They might want you to use println instead of print for the second line of output text. That's the only contradiction to "each time on a new line" I can see. Even though your result is anyway printed on a new line, just technically the next one would be Not on a new line.
0
Hendra
17 November 2019, 07:45
i had tried, but the result is the same...
0