Eu estou um programa simples, e falta criar um aluno dentro do main, para concluir tudo o que foi pedido, mas não estou conseguindo fazer.
package joinsist.modelos;
public class Aluno {
String nome;
String idade;
String matricula;
public Aluno (String nome, String idade, String matricula){
this.nome = nome;
this.idade = idade;
this.matricula = matricula;
}
public Aluno() {
// TODO Auto-generated constructor stub
}
public void imprimirInfo() {
System.out.println("Nome: " + this.nome);
System.out.println("Idade:" + this.idade);
System.out.println("Matricula:" +this.matricula);
}
}
package joinsist;
import joinsist.modelos.Aluno;
public class Alunoprincipal {
public static void main(String[] args) {
// TODO Auto-generated method stub
Aluno aluno1 = new Aluno("Gabriel","20","21133239");
aluno1.imprimirInfo();
}
}
package joinsist;
import java.util.Scanner ;
public class Notasdoaluno {
@SuppressWarnings({ "unused", "resource" })
public static void main (String args[]) {
Scanner ent = new Scanner ( System . in );
int nota1 , nota2 , nota3,nota4 ;
int media;
// 1ª nota
System.out.println ( "1ª nota: " );
nota1 = ent . nextInt ();
// 2ª nota
System.out.println ( "2ª nota: " );
nota2 = ent . nextInt ();
// 3ª nota
System.out.println ( "3ª nota: " );
nota3 = ent . nextInt ();
// 4ª nota
System.out.println ( "4ª nota: " );
nota4= ent . nextInt ();
media = (nota1+nota2+nota3+nota4)/4;
if(media >= 6)
{
System.out.println("Voce está aprovado, boas ferias.");
}
else
{
System.out.println("Voce está reprovado.");
}
System.out.println("A media do aluno é de:" + media );
}
}