From d2c56603b5c271f89f2f514acd302e71c58a43ed Mon Sep 17 00:00:00 2001 From: Cintia Nunes Date: Wed, 22 Aug 2018 20:50:35 -0300 Subject: [PATCH] Add cinta-nunes Exemplo01 --- src/main/java/br/utfpr/tdd/ex1/Aluno.java | 25 ++++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/main/java/br/utfpr/tdd/ex1/Aluno.java b/src/main/java/br/utfpr/tdd/ex1/Aluno.java index 63588d7..56fe384 100644 --- a/src/main/java/br/utfpr/tdd/ex1/Aluno.java +++ b/src/main/java/br/utfpr/tdd/ex1/Aluno.java @@ -8,14 +8,14 @@ * @author andreendo */ public class Aluno { - + private List notasAtividadesPraticas = new ArrayList<>(); private double notaProjeto; private double notaRAA = -1; private int faltas; - private String ra; + private String ra; private String nome; - + public Aluno(String ra, String nome) { this.ra = ra; this.nome = nome; @@ -26,14 +26,15 @@ public void addNotaAtividadePratica(double nota) { } public double getNAP() { - if(notasAtividadesPraticas.isEmpty()) + if (notasAtividadesPraticas.isEmpty()) { return 0.0; - - double nap = 0; + } + + double nap = 0; for (Double nota : notasAtividadesPraticas) { nap += nota; } - + return nap / notasAtividadesPraticas.size(); } @@ -42,10 +43,14 @@ void setNotaProjeto(double nota) { } double getNF() { - if(notaRAA < 0) + if (notaRAA < 0) { return (notaProjeto + getNAP()) / 2.0; - + } + if ((notaProjeto + getNAP() + notaRAA) / 3.0 >= 6.0) { + return 6.0; + } return (notaProjeto + getNAP() + notaRAA) / 3.0; + } void setNotaRAA(double nota) { @@ -79,5 +84,5 @@ public double getNotaProjeto() { public double getNotaRAA() { return notaRAA; } - + }