+ 2
My 5th case Everytime failed. Anyone can help me?
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner x = new Scanner(System.in); int x1 = x.nextInt (); int y1 = x.nextInt (); int dollar = 50*y1; if (dollar<=x1) { System.out.println("Dollars"); } else { System.out.println("Pesos"); } } }
1 Respuesta
+ 2
Akash Agrawal , declare the variable dollar as double type. Change 50 => 50.0. Change also in the if statement dollar < x1. Now I think it works 🐱