Estou aprendendo JAVA na faculdade e treinando em casa. Estou fazendo um exercício. Bom, quando eu rodo o código, ele me pede o nome para cadastrar e depois disso ele da erro e não continua. Sou iniciante e estou me adaptando ao JOptionPane, segue o código:
package lista6;
import java.util.Scanner;
import javax.swing.JOptionPane;
public class Lista6 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String vetor [] = new String[5];
int matriz [][] = new int[5][3];
int menu, cadastro=0, AV1=0, AV2=0, MEDIA;
String nome;
do {
menu = Integer.parseInt(JOptionPane.showInputDialog(null, "0 - Sair \n 1 - Cadastrar Aluno \n 2 - Imprimir"));
switch(menu) {
case 0:
menu = JOptionPane.showConfirmDialog(null,"Deseja realmente sair");
break;
case 1:
if(cadastro <=vetor.length) {
JOptionPane.showInputDialog(null,"Digite o nome");
nome = scan.next();
}
for(int i = 0; i < matriz.length; i++) {
Integer.parseInt(JOptionPane.showInputDialog(null,"Digite nota da AV1"));
AV1 = scan.nextInt();
for(int j = 0; j < matriz.length; j++)
Integer.parseInt(JOptionPane.showInputDialog(null,"Digite nota da AV2"));
AV2 = scan.nextInt();
for(int k = 0; k < matriz.length; k++)
MEDIA = AV1 + AV2/2;
}
}
} while(menu != 0);
}
}