+ 1
What is the error in this code???
I have created a program on Morse code using switch case. Upon entering multiple letters, it prints the Morse code of only the first one. https://code.sololearn.com/c8Ih0bpblNmI/?ref=app https://code.sololearn.com/c8Ih0bpblNmI/?ref=app
4 Answers
+ 1
https://code.sololearn.com/c55X0WSTZPgZ/?ref=app
+ 3
Thank you so much Sami Khan & ~swim~ for your answers.
The program worked!!😃😃
0
use .toLowerCase(); and check only lower letters
String s= n.nextLine().toLowerCase();
...
switch(s.charAt(g)) {
//case 'A':
case 'a':
System.out.print ("•- ");break;