The main method should display the result of the calls, each time on a new line.
convertEurToUsd(50 , 2.5);
// system.out.println(dollars);
this statement is not working as dollars is not defined.
package com.codegym.task.task03.task0303;
/*
Currency exchange
*/
public class Solution {
public static void main(String[] args) {
convertEurToUsd(50 , 2.5);
System.out.println(dollars);
convertEurToUsd(101 , 2.0);
System.out.println(dollars);
//write your code here
}
public static double convertEurToUsd(int eur, double exchangeRate) {
double dollars = 0 ;
dollars = eur * exchangeRate;
return dollars;
//write your code here
}
}