0

I have a problem try to compare variables char the program do not comppile...

will you plase showme the problem...

Scanner sc = new Scanner(System.in);
double desca=0.05;

System.out.println("Categori type *A* o *B*");
char cate = sc.nextChar();
System.out.println("type total to pay a" + cate + ".");
double map = sc.nextDouble();

if(cate=='a')
map=map-(desca*map);

System.out.println("Monto a pagar es de " + map + " pesos.");
  • what is the problem? – Reimeus Mar 29 '18 at 23:27
  • change `char cate = sc.nextChar();` to `char cate = sc.next().charAt(0);`. please read the java documentation or search online for help before coming here to post questions. thanks :) – Ousmane D. Mar 29 '18 at 23:31

0 Answers0