generated from poo-2024-q2/student-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package universidade; | ||
|
||
/** | ||
* Modelo de estudante de graduação da UFABC | ||
*/ | ||
public class Estudante { | ||
private String nome; | ||
private String ra; | ||
private double[] notas; | ||
|
||
/** | ||
* constroi um novo estudante. | ||
* | ||
* @param nome O nome completo do estudante | ||
* @param ra O no formato UFABC | ||
* @param notas as notas obtidas (de 0 a 10) | ||
*/ | ||
public Estudante( String nome, String ra, double[] notas) { | ||
this.nome = nome; | ||
this.ra = ra; | ||
this.notas = notas; | ||
} | ||
|
||
private void validaRa(String ra) { | ||
if (!ra.matches("\\d(11)")) { | ||
throw new IllegalArgumentException("RA fora do formato"); | ||
} | ||
} | ||
|
||
public String getNome() { | ||
return nome; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
} |