Hi i submitted my code 3 times now . these are the errors that return .
System.out.println(result)
^ Java: 16 : error cannot find symbol
return result;
^ incompatible types
Unexpected return value .
notice that system does not accept my verify attempts .
all code is in the main method.
convertEurToUsd(5,120);
converEurToUsd(15,100);
System.out.println(convertToUsd(5,120));
System.out.println(convertToUsd(15,100));
System.out.println(result);
return result;
Thank you
Mike McKenna
return statement verify
Under discussion
Comments (5)
- Popular
- New
- Old
You must be signed in to leave a comment
Bopal Vicki
20 May 2019, 05:14
YOU DONT HAVE TO PRINT THE RESULT [System.out.println(result)].
WHEN YOU ARE CALLING A METHOD WHICH HAS RETURN TYPE .
package com.codegym.task.task03.task0303;
public class Solution {
public static void main(String[] args) {
System.out.println(convertEurToUsd(5,20));
System.out.println(convertEurToUsd(6,10));
}
public static double convertEurToUsd(int eur, double exchangeRate) {
double us = eur*exchangeRate;
return us;
}
}
0
Mike McKenna
19 May 2019, 01:01
Hi Guadalupe,
I can not send the task page . the system will not allow me to verify x3 .
public class Solution {
public static void main(String[ ] args {
convertEurtoUsd(5,120);
convertEurToUsd(15,100);
System.out.println(convertEurToUsd(5,120));
System.out.println(convertEurToUsd(15,100));
System.out.println(result);
return result;
Thank you
Mike McKenna
0
Cheikh Sambakhe
18 May 2019, 21:54
Hello,
First of all, you said all your code was in the main method and that, is your 1st error. The exercise ask you to write in the convertToUsd method
Second, you need to put your second argument in the function convertToUsd as a double .
Can you please share your code for us to better help you ?
0
Guadalupe Gagnon
18 May 2019, 19:18
You need to share your code or we can not help:
.
.
![]()

0
Thomas
19 May 2019, 05:07
hahaha
0