Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51289aff1e | ||
|
|
e85b311034 | ||
|
|
938d7af3ed |
4 changed files with 61 additions and 98 deletions
|
|
@ -7,86 +7,50 @@ public class Acompanhamento {
|
|||
private int atividadesNaoEstudadas;
|
||||
private double riscoPedagogico;
|
||||
|
||||
public Acompanhamento(Aluno aluno, int atividadesEntregues, int atividadesIA, int atividadesExplicadas,
|
||||
int atividadesSemAjuda, int atividadesNaoEstudadas) {
|
||||
public Acompanhamento(Aluno aluno, int atividadesEntregues, int atividadesIA, int atividadesExplicadas, int atividadesSemAjuda, int atividadesNaoEstudadas){
|
||||
|
||||
this.aluno = aluno;
|
||||
this.atividadesEntregues = atividadesEntregues;
|
||||
this.atividadesIA = atividadesIA;
|
||||
this.atividadesExplicadas = atividadesExplicadas;
|
||||
this.atividadesSemAjuda = atividadesSemAjuda;
|
||||
this.atividadesNaoEstudadas = atividadesNaoEstudadas;
|
||||
|
||||
this.riscoPedagogico = this.calcularRisco();
|
||||
}
|
||||
|
||||
private void calcularRisco() {
|
||||
double razaoIa = atividadesIA / atividadesEntregues;
|
||||
double razaoNaoExplicadas = (atividadesEntregues - atividadesExplicadas) / atividadesEntregues;
|
||||
double razaoComAjuda = (atividadesEntregues - atividadesSemAjuda) / atividadesEntregues;
|
||||
double razaoNaoEstudadas = atividadesNaoEstudadas / atividadesEntregues;
|
||||
double media = (razaoIa + razaoNaoExplicadas + razaoComAjuda + razaoNaoEstudadas) / 4;
|
||||
this.riscoPedagogico = media * 10;
|
||||
private double calcularRisco(){
|
||||
double razaoIa = (double) atividadesIA / (double) atividadesEntregues;
|
||||
double razaoNaoExplicadas = (double) (atividadesEntregues - atividadesExplicadas) / (double) atividadesEntregues;
|
||||
double razaoComAjuda = (double) (atividadesEntregues - atividadesSemAjuda) / (double) atividadesEntregues;
|
||||
double razaoNaoEstudadas = (double) atividadesNaoEstudadas / (double) atividadesEntregues;
|
||||
double media = (razaoIa + razaoNaoExplicadas + razaoComAjuda + razaoNaoEstudadas) / (double) 4;
|
||||
|
||||
return media * 10;
|
||||
}
|
||||
|
||||
public double getRiscoPedagogico() {
|
||||
this.calcularRisco();
|
||||
return riscoPedagogico;
|
||||
public double getRiscoPedagogico(){
|
||||
return this.calcularRisco();
|
||||
}
|
||||
|
||||
public String getRiscoLabel() {
|
||||
this.calcularRisco();
|
||||
if (riscoPedagogico <= 3.3) {
|
||||
public String getRiscoLabel(){
|
||||
this.riscoPedagogico = this.calcularRisco();
|
||||
|
||||
if (this.riscoPedagogico <= 3.3){
|
||||
return "O risco pedagógico deste aluno é BAIXO";
|
||||
}
|
||||
if (riscoPedagogico > 3.3 && riscoPedagogico < 6.6) {
|
||||
if (this.riscoPedagogico > 3.3 && this.riscoPedagogico < 6.6){
|
||||
return "O risco pedagógico deste aluno é MODERADO";
|
||||
}
|
||||
if (riscoPedagogico >= 6.6) {
|
||||
if (this.riscoPedagogico >= 6.6){
|
||||
return "O risco pedagógico deste aluno é ALTO";
|
||||
}
|
||||
|
||||
return Erro.E7;
|
||||
}
|
||||
|
||||
public Aluno getAluno() {
|
||||
public Aluno getAluno(){
|
||||
return this.aluno;
|
||||
}
|
||||
|
||||
public void setAluno(Aluno aluno) {
|
||||
this.aluno = aluno;
|
||||
}
|
||||
|
||||
public void setAtividadesEntregues(int atividadesEntregues) {
|
||||
this.atividadesEntregues = atividadesEntregues;
|
||||
}
|
||||
|
||||
public boolean setAtividadesIA(int atividadesIA) {
|
||||
if (atividadesIA > atividadesEntregues) {
|
||||
return true;
|
||||
}
|
||||
this.atividadesIA = atividadesIA;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean setAtividadesExplicadas(int atividadesExplicadas) {
|
||||
if (atividadesExplicadas > atividadesEntregues) {
|
||||
return true;
|
||||
}
|
||||
this.atividadesExplicadas = atividadesExplicadas;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean setAtividadesSemAjuda(int atividadesSemAjuda) {
|
||||
if (atividadesSemAjuda > atividadesEntregues) {
|
||||
return true;
|
||||
}
|
||||
this.atividadesSemAjuda = atividadesSemAjuda;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean setAtividadesNaoEstudadas(int atividadesNaoEstudadas) {
|
||||
if (atividadesNaoEstudadas > atividadesEntregues) {
|
||||
return true;
|
||||
}
|
||||
this.atividadesNaoEstudadas = atividadesNaoEstudadas;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
34
Dados.java
34
Dados.java
|
|
@ -33,8 +33,12 @@ public class Dados {
|
|||
}
|
||||
|
||||
public String appendAcompanhamento(Acompanhamento acomp){
|
||||
if (checkDuplicate(acomp.getAluno().getNome())){
|
||||
return Erro.E3;
|
||||
|
||||
int index = findAcompanhamentoIndex(acomp.getAluno().getNome());
|
||||
|
||||
if (index != -1){
|
||||
acompanhamentos[index] = acomp;
|
||||
return "Acompanhamento atualizado com sucesso.";
|
||||
}
|
||||
|
||||
int size = this.acompanhamentos.length;
|
||||
|
|
@ -51,10 +55,15 @@ public class Dados {
|
|||
return "Acompanhamento cadastrado com sucesso.";
|
||||
}
|
||||
|
||||
public String appendBolsista(Bolsista bolsista){
|
||||
if (checkDuplicate(bolsista.getNome())){
|
||||
return Erro.E3;
|
||||
public int findAcompanhamentoIndex(String nome){
|
||||
for (int i = 0; i < acompanhamentos.length; i++){
|
||||
if (nome.equals(acompanhamentos[i].getAluno().getNome()))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public String appendBolsista(Bolsista bolsista){
|
||||
|
||||
int size = this.bolsistas.length;
|
||||
|
||||
|
|
@ -68,8 +77,6 @@ public class Dados {
|
|||
this.bolsistas = novoArray;
|
||||
|
||||
return "Bolsista cadastrado com sucesso.";
|
||||
|
||||
|
||||
}
|
||||
|
||||
private boolean checkDuplicate(String nome){
|
||||
|
|
@ -101,13 +108,12 @@ public class Dados {
|
|||
}
|
||||
|
||||
public Acompanhamento findAcompanhamento(String nome){
|
||||
for (int i = 0; i < acompanhamentos.length; i++){
|
||||
if (acompanhamentos[i].getAluno().getNome().equals(nome)) {
|
||||
return acompanhamentos[i];
|
||||
}
|
||||
}
|
||||
int index = findAcompanhamentoIndex(nome);
|
||||
|
||||
if (index == -1)
|
||||
return null;
|
||||
|
||||
return acompanhamentos[index];
|
||||
}
|
||||
|
||||
public String listAlunos(){
|
||||
|
|
@ -141,7 +147,7 @@ public class Dados {
|
|||
String relatorio = "";
|
||||
|
||||
for (int i = 0; i < acompanhamentos.length; i++){
|
||||
relatorio = relatorio.concat(acompanhamentos[i].getAluno().getNome() + ": Risco ");
|
||||
relatorio = relatorio.concat(acompanhamentos[i].getAluno().getNome());
|
||||
relatorio = relatorio.concat(acompanhamentos[i].getRiscoLabel() + "\n");
|
||||
}
|
||||
|
||||
|
|
@ -170,6 +176,8 @@ public class Dados {
|
|||
public String maiorNome(){
|
||||
if (alunos.length == 0)
|
||||
return Erro.E5;
|
||||
if (alunos.length == 1)
|
||||
return alunos[0].getNome();
|
||||
|
||||
int k = 0;
|
||||
for (int i = 1; i < alunos.length; i++){
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@ public class Erro {
|
|||
public static final String E1 = "Erro: Opção do menu inválida.";
|
||||
public static final String E2 = "Erro: Aluno não encontrado.";
|
||||
public static final String E3 = "Erro: Já existe um aluno com esse nome.";
|
||||
public static final String E4 = "Erro: Você escolheu um número maior do que o total de atividades entregues.";
|
||||
public static final String E4 = "Erro: Você inseriu numeros inválidos de atividades.";
|
||||
public static final String E5 = "Erro: Não existem alunos cadastrados.";
|
||||
public static final String E6 = "Erro: Nenhuma chamada foi criada.";
|
||||
public static final String E7 = "Erro: Não foi possível calcular o risco pedagógico.";
|
||||
public static final String E8 = "Erro: Não existem acompanhamentos cadastrados.";
|
||||
public static final String E9 = "Erro: Não existe nenhum aluno com risco alto.";
|
||||
public static final String E10 = "Erro: Acompanhamento não encontrado.";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,19 @@
|
|||
// TODO: buffer clears
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Gerenciador {
|
||||
private Dados dados;
|
||||
private static Scanner input = new Scanner(System.in);
|
||||
|
||||
String nome = "", local = "", curso = "", matricula = "", projeto = "", orientador = "";
|
||||
int idade = 0, semestre = 0, ano = 0;
|
||||
boolean bolsista = false;
|
||||
|
||||
|
||||
public Gerenciador(Dados dados) {
|
||||
this.dados = dados;
|
||||
}
|
||||
|
||||
public String cadastrarAluno() {
|
||||
String nome = "", local = "", curso = "", matricula = "";
|
||||
int idade = 0, semestre = 0, ano = 0;
|
||||
|
||||
while (nome.length() == 0){
|
||||
System.out.println("Insira o nome do aluno:");
|
||||
nome = input.nextLine();}
|
||||
|
|
@ -60,6 +59,7 @@ public class Gerenciador {
|
|||
}
|
||||
|
||||
public String cadastrarBolsista(boolean resposta, Aluno alunoparametro) {
|
||||
String projeto = "", orientador = "";
|
||||
|
||||
Aluno aluno;
|
||||
|
||||
|
|
@ -74,11 +74,11 @@ public class Gerenciador {
|
|||
|
||||
while (projeto.length() == 0){
|
||||
System.out.println("Insira o nome do projeto:");
|
||||
String projeto = input.nextLine();}
|
||||
projeto = input.nextLine();}
|
||||
|
||||
while (orientador.length() == 0){
|
||||
System.out.println("Insira o nome do orientador:");
|
||||
String orientador = input.nextLine();}
|
||||
orientador = input.nextLine();}
|
||||
|
||||
Bolsista bolsista = new Bolsista(aluno, projeto, orientador);
|
||||
aluno.setBolsista(true);
|
||||
|
|
@ -94,43 +94,33 @@ public class Gerenciador {
|
|||
if (aluno == null)
|
||||
return Erro.E2;
|
||||
|
||||
Acompanhamento acomp = new Acompanhamento(aluno, 0, 0, 0, 0, 0);
|
||||
|
||||
System.out.println("Insira a quantidade de atividades entregues:");
|
||||
int entregues = input.nextInt();
|
||||
input.nextLine(); //buffer clear
|
||||
acomp.setAtividadesEntregues(entregues);
|
||||
|
||||
System.out.println("Insira a quantidade de atividades entregues nas quais foi declarado o uso de IA:");
|
||||
int ia = input.nextInt();
|
||||
input.nextLine(); //buffer clear
|
||||
if (acomp.setAtividadesIA(ia))
|
||||
return Erro.E4;
|
||||
|
||||
System.out.println("Insira a quantidade de atividades entregues que o aluno soube explicar:");
|
||||
int explicadas = input.nextInt();
|
||||
input.nextLine(); //buffer clear
|
||||
if (acomp.setAtividadesExplicadas(explicadas))
|
||||
return Erro.E4;
|
||||
|
||||
System.out.println("Insira a quantidade de atividades entregues que foram feitas sem ajuda:");
|
||||
int semajuda = input.nextInt();
|
||||
input.nextLine(); //buffer clear
|
||||
if (acomp.setAtividadesSemAjuda(semajuda))
|
||||
return Erro.E4;
|
||||
|
||||
System.out.println("Insira a quanntidade de atividades entregues que utilizarão estruturas não estudadas:");
|
||||
System.out.println("Insira a quanntidade de atividades entregues que utilizaram estruturas não estudadas:");
|
||||
int naoestudadas = input.nextInt();
|
||||
input.nextLine(); //buffer clear
|
||||
if (acomp.setAtividadesNaoEstudadas(naoestudadas))
|
||||
|
||||
if (ia > entregues || explicadas > entregues || semajuda > entregues || naoestudadas > entregues){
|
||||
return Erro.E4;
|
||||
}
|
||||
|
||||
if (ia + explicadas + semajuda + naoestudadas > entregues)
|
||||
return Erro.E4;
|
||||
|
||||
this.dados.appendAcompanhamento(acomp);
|
||||
return "Acompanhamento registrado com sucesso.";
|
||||
Acompanhamento acomp = new Acompanhamento(aluno, entregues, ia, explicadas, semajuda, naoestudadas);
|
||||
|
||||
return this.dados.appendAcompanhamento(acomp);
|
||||
}
|
||||
|
||||
public String listarAlunos() {
|
||||
|
|
@ -183,7 +173,7 @@ public class Gerenciador {
|
|||
System.out.println("Insira o nome de um aluno:");
|
||||
Acompanhamento acomp = this.dados.findAcompanhamento(input.nextLine());
|
||||
if (acomp == null)
|
||||
return Erro.E2;
|
||||
return Erro.E10;
|
||||
|
||||
return acomp.getRiscoLabel();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue