Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package aluno;
- import javax.swing.JOptionPane;
- public class AlunoEntrada {
- public static void main(String[] args) {
- Aluno aluno[] = new Aluno[3];
- int i;
- for(i = 0; i< aluno.length; i++) {
- aluno[i] = new Aluno ();
- aluno[i].nome = JOptionPane.showInputDialog("Nome: ");
- aluno[i].idade = Integer.parseInt(JOptionPane.showInputDialog("Idade: "));
- aluno[i].nota = Double.parseDouble(JOptionPane.showInputDialog("Nota: "));
- }
- for(i = 0; i< aluno.length; i++) {
- System.out.println("Nome: "+aluno[i].nome+"- Idade: "+aluno[i].idade+"- Nota: "+aluno[i].nota+ "\n");
- }
- }
- }
- // classe
- package aluno;
- class Aluno {
- public String nome;
- public int idade;
- public double nota;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement