0

Compilation error

https://code.sololearn.com/cA0tCksvXvle/?ref=app I need help, anyone know how to fix it? I want to turn every letter into uppercase et some letters into numbers (A->4 ; E->3; O->0;...)

26th Jul 2019, 9:33 AM
GreeFoss XD
GreeFoss XD - avatar
2 Answers
+ 1
//with .toUpperCase(); public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("votre texte:"); String texte = sc.nextLine(); System.out.println(texte); System.out.println("________________________"); String textenum = texte.toUpperCase() .replace("A","4") .replace("E","3") .replace("I","1") .replace("T","7") .replace("O","0") .replace("B","8") .replace("S","5") .replace("G","6") .replace("Z","2"); System.out.println(textenum); } }
26th Jul 2019, 10:39 AM
zemiak