The question is:
1) Help the university to assemble the divisions of the programming lab. To do this, write an algorithm that reads the name of the student and say in which division he is respecting the rule below:
-children whose name begins with the letters from A to K are in D1 ;
- Students whose name begins with the letters of L and N are in D2 ;
- Students whose name begins with the letters from O to Z are in D3 .
Tip: Use the charAt(posição)
method?
public class ex4a3{
public static void main (String[] args){
String nome = JOptionPane.showInputDialog("Digite seu nome para
descobrir sua divisao:");
char letra = nome.charAt(0);
if(letra >= "a" && letra <= "l"){
JOptionPane.showMessageDialog(null,"Voce esta na divisao D1");
}
}
}