Pessoal, to com um problema na logica desse codigo, para muitos e simples d +, mas eu n to conseguindo :wink: , sera q alguem pd me ajudar ??? :roll:
String nome[];
int sala[];
double nota[];
double media[];
String esc;
nome = new String[3];
sala = new int[3];
nota = new double[3];
media = new double[3];
double total;
/* Cadastro */
for( int cont = 0; cont < 3; cont++ ) {
total = 0;
nome[cont] = JOptionPane.showInputDialog(
"Aluno -> " + (cont + 1) +
"\nDigite o nome" );
sala[cont] = Integer.parseInt(
JOptionPane.showInputDialog(
"Digite a sala" ) );
for( int i = 0; i < 3; i ++ ) {
do {
nota[i] = 0;
nota[i] = Double.parseDouble(
JOptionPane.showInputDialog(
"Digite a " + ( i + 1 ) +
"ª nota da prova" ) );
if( ( nota[i] > 10 ) || ( nota[i] < 0) ) {
JOptionPane.showMessageDialog( null,
"A nota tem q estar entre 0 e 10", "Valor Inválido !!",
JOptionPane.WARNING_MESSAGE );
} // fim do if
} while( ( nota[i] > 10 ) || ( nota[i] < 0 ) );
total += nota[i];
} // fim do for
media[cont] = total / 3;
} // fim do for
Abracao e te +

