+ 3

Argentina java

I got 4 out of 5 but can't figure out what I do wrong cause if I calculate it comes out right import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner num = new Scanner(System.in); int pesos = num.nextInt(); int dollars = num.nextInt(); double d = dollars/50; double p = pesos; if (d>=p){ System.out.print("Pesos");} else{ System.out.print("Dollars");} } }

19th Jul 2020, 7:24 PM
Tom Dierckx
Tom Dierckx - avatar
2 Answers
+ 12
Input Format Two integer values, the first one is the price in Pesos and the second one is the price in Dollars. The exchange rate is 2 cents for every Peso. By your logic, Dollars getting lower than Pesos. So, have a idea to fix it?
19th Jul 2020, 7:37 PM
ᎴRidwan_
ᎴRidwan_ - avatar
0
Thx alot, figured it out!
19th Jul 2020, 7:45 PM
Tom Dierckx
Tom Dierckx - avatar