-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExemplo01.java
More file actions
24 lines (22 loc) · 860 Bytes
/
Exemplo01.java
File metadata and controls
24 lines (22 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.Scanner;
public class Exemplo01 {
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
Aluno alunos[];
alunos = new Aluno[20]; //
System.out.println(alunos);
for (int i = 0; i < alunos.length; i++) {
System.out.println("Informe a nome do "+(i+1)+"o. aluno: ");
String nome = entrada.next();
System.out.println("Informe a matricula do "+(i+1)+"o. aluno: ");
int matricula = entrada.nextInt();
System.out.println("Informe a Nota do "+(i+1)+"o. aluno: ");
double nota = entrada.nextDouble();
alunos[i]=new Aluno(matricula,nome,nota);
}
//mostrar
for (int i = 0; i < alunos.length; i++) {
System.out.println(alunos[i]);
}
}
}