-4
The question is this::
1)Help the university set up the divisions of the programming laboratory. For this, write an algorithm that reads the student’s name and tells which division he is respecting the rule below:
-students whose name begins with letters of To to K are in the D1;
-students whose name begins with the letters of L to N are in the D2;
-students whose name begins with the letters of The to Z are in the D3.
Tip: use the method charAt(posição)
?
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");
}
}
}
It would be better if you asked a question or stated what the problem is instead of passing the question as an exercise, as it would help in your understanding of the exercise, instead of receiving you ready without understanding and instead of learning need help every time you need to do an exercise.
– Gabriel C.