This question already has an answer here:
- Take a char input from the Scanner 17 answers
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