Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/main/java/br/utfpr/tdd/ex1/Aluno.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ void setNotaProjeto(double nota) {
}

double getNF() {
if(notaRAA < 0)
if(notaRAA < 0) {
return (notaProjeto + getNAP()) / 2.0;
}

return (notaProjeto + getNAP() + notaRAA) / 3.0;
if (((notaProjeto + getNAP() + notaRAA) / 3.0) > 6) {
return 6;
} else {
return (notaProjeto + getNAP() + notaRAA) / 3.0;
}
}

void setNotaRAA(double nota) {
Expand Down
4 changes: 4 additions & 0 deletions src/test/java/br/utfpr/tdd/ex1/AlunoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public void testNotaFinalComRAANoMaximoSeis() {
aluno.setNotaProjeto(5.0);
aluno.setNotaRAA(10.0);

// 5 ATIVIDADE PRÁTICA
// 5 ATIVIDADE PRÁTICA
// 10 RAA
// 20 / 3 = 6.6, corrigido para no máximo 6
assertEquals(6.0, aluno.getNF(), 0.01);
}
}