jeudi 29 mars 2018

Char variable comparison issue in java [duplicate]

This question already has an answer here:

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.");

Aucun commentaire:

Enregistrer un commentaire