Compare commits
15 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21bd0d7432 | ||
|
|
0b5ff1b326 | ||
|
|
5016c8aef9 | ||
|
|
865323702f | ||
|
|
f4e39f6fae | ||
|
|
2ed1e404b1 | ||
|
|
40e0b63fdb | ||
|
|
26191b776d | ||
|
|
e4328b8828 | ||
|
|
28499648e3 | ||
|
|
2233b51b86 | ||
|
|
6d58b324b7 | ||
|
|
e2ca24a21d | ||
|
|
ea48ef7541 | ||
|
|
e4f0f7e7e9 |
6 changed files with 222 additions and 307 deletions
|
|
@ -7,86 +7,49 @@ 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) {
|
||||
return "O risco pedagógico deste aluno é BAIXO";
|
||||
public String getRiscoLabel(){
|
||||
this.riscoPedagogico = this.calcularRisco();
|
||||
|
||||
if (this.riscoPedagogico <= 3.3){
|
||||
return "O risco pedagogico deste aluno eh BAIXO";
|
||||
}
|
||||
if (riscoPedagogico > 3.3 && riscoPedagogico < 6.6) {
|
||||
return "O risco pedagógico deste aluno é MODERADO";
|
||||
if (this.riscoPedagogico > 3.3 && this.riscoPedagogico < 6.6){
|
||||
return "O risco pedagogico deste aluno eh MODERADO";
|
||||
}
|
||||
if (riscoPedagogico >= 6.6) {
|
||||
return "O risco pedagógico deste aluno é ALTO";
|
||||
if (this.riscoPedagogico >= 6.6){
|
||||
return "O risco pedagogico deste aluno eh 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;
|
||||
}
|
||||
}
|
||||
175
Dados.java
175
Dados.java
|
|
@ -1,5 +1,3 @@
|
|||
// TODO: acentos no isVowel()
|
||||
|
||||
public class Dados {
|
||||
private Aluno[] alunos;
|
||||
private String chamada;
|
||||
|
|
@ -14,9 +12,7 @@ public class Dados {
|
|||
}
|
||||
|
||||
public String appendAluno(Aluno aluno){
|
||||
if (checkDuplicate(aluno.getNome())){
|
||||
return Erro.E3;
|
||||
}
|
||||
if (checkDuplicate(aluno.getNome())) {return Erro.E3;}
|
||||
|
||||
int size = this.alunos.length;
|
||||
|
||||
|
|
@ -33,8 +29,11 @@ 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,9 +50,21 @@ public class Dados {
|
|||
return "Acompanhamento cadastrado com sucesso.";
|
||||
}
|
||||
|
||||
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){
|
||||
if (checkDuplicate(bolsista.getNome())){
|
||||
return Erro.E3;
|
||||
int index = findBolsistaIndex(bolsista.getNome());
|
||||
|
||||
if (index != -1){
|
||||
bolsistas[index] = bolsista;
|
||||
return "Bolsista atualizado com sucesso.";
|
||||
}
|
||||
|
||||
int size = this.bolsistas.length;
|
||||
|
|
@ -67,9 +78,7 @@ public class Dados {
|
|||
novoArray[size] = bolsista;
|
||||
this.bolsistas = novoArray;
|
||||
|
||||
return "Bolsista cadastrado com sucesso.";
|
||||
|
||||
|
||||
return "Bolsista cadastrado com sucesso.";
|
||||
}
|
||||
|
||||
private boolean checkDuplicate(String nome){
|
||||
|
|
@ -87,33 +96,36 @@ public class Dados {
|
|||
if (nome.equals(alunos[i].getNome()))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
private int findBolsistaIndex(String nome){
|
||||
for (int i = 0; i < bolsistas.length; i++){
|
||||
if (nome.equals(bolsistas[i].getNome()))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public Aluno findAluno(String nome){
|
||||
int index = findAlunoIndex(nome);
|
||||
|
||||
if (index == -1){
|
||||
return null;
|
||||
}
|
||||
|
||||
return alunos[index];
|
||||
if (index == -1) {return null;}
|
||||
else {return alunos[index];}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
return null;
|
||||
if (index == -1) {return null;}
|
||||
else {return acompanhamentos[index];}
|
||||
}
|
||||
|
||||
public String listAlunos(){
|
||||
if (alunos.length == 0)
|
||||
return Erro.E5;
|
||||
|
||||
if (alunos.length == 0) {return Erro.E5;}
|
||||
|
||||
String lista = "";
|
||||
for (int i = 0; i < alunos.length; i++){
|
||||
lista = lista.concat(alunos[i].getNome() + "\n");
|
||||
|
|
@ -123,8 +135,7 @@ public class Dados {
|
|||
}
|
||||
|
||||
public String listBolsistas(){
|
||||
if (bolsistas.length == 0)
|
||||
return Erro.E5;
|
||||
if (bolsistas.length == 0) {return Erro.E5;}
|
||||
|
||||
String lista = "";
|
||||
for (int i = 0; i < bolsistas.length; i++){
|
||||
|
|
@ -135,54 +146,51 @@ public class Dados {
|
|||
}
|
||||
|
||||
public String riskReport(){
|
||||
if (acompanhamentos.length == 0)
|
||||
return Erro.E8;
|
||||
|
||||
if (acompanhamentos.length == 0) {return Erro.E8;}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
return relatorio;
|
||||
|
||||
}
|
||||
|
||||
public String riskReportHigh(){
|
||||
if (acompanhamentos.length == 0)
|
||||
return Erro.E8;
|
||||
if (acompanhamentos.length == 0) {return Erro.E8;}
|
||||
|
||||
String relatorio = "";
|
||||
|
||||
for (int i = 0; i < acompanhamentos.length; i++){
|
||||
if (acompanhamentos[i].getRiscoLabel().equals("ALTO")){
|
||||
if (acompanhamentos[i].getRiscoPedagogico() >= 6.6){
|
||||
relatorio = relatorio.concat(acompanhamentos[i].getAluno().getNome() + ": Risco ALTO\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (relatorio.length() == 0)
|
||||
return Erro.E9;
|
||||
if (relatorio.length() == 0) {return Erro.E9;}
|
||||
|
||||
return relatorio;
|
||||
}
|
||||
|
||||
public String maiorNome(){
|
||||
if (alunos.length == 0)
|
||||
return Erro.E5;
|
||||
|
||||
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++){
|
||||
if (alunos[i].getNome().length() > alunos[k].getNome().length())
|
||||
k = i;
|
||||
}
|
||||
|
||||
return alunos[k].getNome();
|
||||
}
|
||||
|
||||
public String averageAge(){
|
||||
if (alunos.length == 0)
|
||||
return Erro.E5;
|
||||
|
||||
if (alunos.length == 0) {return Erro.E5;}
|
||||
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < alunos.length; i++){
|
||||
|
|
@ -190,13 +198,12 @@ public class Dados {
|
|||
}
|
||||
|
||||
sum = sum / alunos.length;
|
||||
return "Idade média dos alunos: " + sum;
|
||||
return "Idade media dos alunos: " + sum;
|
||||
}
|
||||
|
||||
public String totalVowels(){
|
||||
if (alunos.length == 0)
|
||||
return Erro.E5;
|
||||
|
||||
if (alunos.length == 0) {return Erro.E5;}
|
||||
|
||||
int sum = 0;
|
||||
|
||||
for (int k = 0; k < alunos.length; k++){
|
||||
|
|
@ -208,38 +215,39 @@ public class Dados {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
return "Numero total de vogais:" + sum;
|
||||
}
|
||||
|
||||
private boolean isVowel(char a){
|
||||
|
||||
return (a == 'a') || (a == 'e') || (a == 'i') || (a == 'o') || (a == 'u') || (a == 'A') || (a == 'E') || (a == 'I') || (a == 'O') || (a == 'U');
|
||||
|
||||
return (a == 'a') || (a == 'e') || (a == 'i') || (a == 'o') || (a == 'u')
|
||||
|| (a == 'A') || (a == 'E') || (a == 'I') || (a == 'O') || (a == 'U');
|
||||
}
|
||||
|
||||
public void makeChamada(){
|
||||
this.chamada = "";
|
||||
|
||||
if (alunos.length == 0){
|
||||
this.chamada = Erro.E5;
|
||||
} else {
|
||||
for (int i = 0; i < alunos.length; i++){
|
||||
this.chamada = this.chamada.concat(alunos[i].getMatricula() + " / ");
|
||||
this.chamada = this.chamada.concat(alunos[i].getNome() + " / ");
|
||||
this.chamada = this.chamada.concat(alunos[i].getCurso() + "\n");
|
||||
}
|
||||
}
|
||||
if (alunos.length == 0) {return;}
|
||||
|
||||
for (int i = 0; i < alunos.length; i++){
|
||||
this.chamada = this.chamada.concat(alunos[i].getMatricula() + " / ");
|
||||
this.chamada = this.chamada.concat(alunos[i].getNome() + " / ");
|
||||
this.chamada = this.chamada.concat(alunos[i].getCurso() + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
public String printChamada(){
|
||||
if (chamada.length() == 0)
|
||||
return Erro.E6;
|
||||
if (chamada.length() == 0) {return Erro.E6;}
|
||||
|
||||
return chamada;
|
||||
}
|
||||
|
||||
public String getChamada(){
|
||||
return chamada;
|
||||
}
|
||||
|
||||
public double coursePercent(String curso){
|
||||
if (alunos.length == 0) {return -1;}
|
||||
|
||||
double num = 0;
|
||||
|
||||
for (int i = 0; i < alunos.length; i++){
|
||||
|
|
@ -249,4 +257,43 @@ public class Dados {
|
|||
|
||||
return (num / alunos.length) * 100;
|
||||
}
|
||||
}
|
||||
|
||||
public String rankingRisco(){
|
||||
if (acompanhamentos.length == 0) {return Erro.E8;}
|
||||
|
||||
int size = acompanhamentos.length;
|
||||
Acompanhamento[] sorted = new Acompanhamento[size];
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < size; i++){
|
||||
sorted[i] = acompanhamentos[i];
|
||||
sum += sorted[i].getRiscoPedagogico();
|
||||
}
|
||||
|
||||
Acompanhamento aux;
|
||||
|
||||
while (true){
|
||||
boolean c = false;
|
||||
|
||||
for (int i = 0; i+1 < size; i++){
|
||||
if (sorted[i].getRiscoPedagogico() < sorted[i+1].getRiscoPedagogico()){
|
||||
aux = sorted[i];
|
||||
sorted[i] = sorted[i+1];
|
||||
sorted[i+1] = aux;
|
||||
c = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!c){break;}
|
||||
}
|
||||
|
||||
String ranking = "";
|
||||
|
||||
for (int i = 0; i < size; i++){
|
||||
ranking += "Aluno: " + sorted[i].getAluno().getNome() + ". " + sorted[i].getRiscoLabel() + "\n";
|
||||
}
|
||||
|
||||
ranking += "\nA media de risco eh: " + sum/size;
|
||||
return ranking;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
21
Erro.java
21
Erro.java
|
|
@ -1,11 +1,14 @@
|
|||
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 E5 = "Erro: Não existem alunos cadastrados.";
|
||||
public static final String E0 = "Erro: Um erro inesperado ocorreu: ";
|
||||
public static final String E1 = "Erro: Opcao do menu invalida.";
|
||||
public static final String E2 = "Erro: Aluno nao encontrado.";
|
||||
public static final String E3 = "Erro: Ja existe um aluno com esse nome.";
|
||||
public static final String E4 = "Erro: Voce inseriu numeros invalidos de atividades.";
|
||||
public static final String E5 = "Erro: Nao 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 E7 = "Erro: Nao foi possivel calcular o risco pedagogico.";
|
||||
public static final String E8 = "Erro: Nao existem acompanhamentos cadastrados.";
|
||||
public static final String E9 = "Erro: Nao existe nenhum aluno com risco alto.";
|
||||
public static final String E10 = "Erro: Acompanhamento nao encontrado.";
|
||||
public static final String E11 = "Errro: Voce inseriu um dado invalido.";
|
||||
}
|
||||
128
Gerenciador.java
128
Gerenciador.java
|
|
@ -1,136 +1,130 @@
|
|||
// 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() {
|
||||
while (nome.length() == 0){
|
||||
String nome = "", local = "", curso = "", matricula = "";
|
||||
int idade = 0, semestre = 0, ano = 0;
|
||||
|
||||
while (nome.length() == 0){// Repete a pergunta até que uma resposta seja digitada
|
||||
System.out.println("Insira o nome do aluno:");
|
||||
nome = input.nextLine();}
|
||||
|
||||
while (local.length() == 0){
|
||||
while (local.length() == 0){// Repete a pergunta até que uma resposta seja digitada
|
||||
System.out.println("Insira o local de nascimento do aluno:");
|
||||
local = input.nextLine();}
|
||||
|
||||
while (curso.length() == 0){
|
||||
System.out.println("Insira o curso do aluno:");
|
||||
curso = input.nextLine();}
|
||||
while (curso.length() == 0){// Repete a pergunta até que uma resposta seja digitada
|
||||
System.out.println("Insira o curso do aluno:");
|
||||
curso = input.nextLine();}
|
||||
|
||||
while (matricula.length() == 0){
|
||||
while (matricula.length() == 0){// Repete a pergunta até que uma resposta seja digitada
|
||||
System.out.println("Insira a matricula do aluno:");
|
||||
matricula = input.nextLine();}
|
||||
|
||||
while (idade == 0 ){
|
||||
while (idade == 0 ){// Repete a pergunta até que uma resposta seja digitada
|
||||
System.out.println("Insira a idade do aluno:");
|
||||
idade = input.nextInt();
|
||||
input.nextLine();} //buffer clear
|
||||
|
||||
while (semestre == 0){
|
||||
input.nextLine(); //buffer clear
|
||||
if (idade < 0) {return Erro.E11;}}
|
||||
|
||||
while (semestre == 0){// Repete a pergunta até que uma resposta seja digitada
|
||||
System.out.println("Insira o semestre do aluno:");
|
||||
semestre = input.nextInt();
|
||||
input.nextLine();} //buffer clear
|
||||
|
||||
while (ano == 0){
|
||||
input.nextLine(); //buffer clear
|
||||
if (semestre < 0) {return Erro.E11;}}
|
||||
|
||||
while (ano == 0){// Repete a pergunta até que uma resposta seja digitada
|
||||
System.out.println("Insira o ano do aluno:");
|
||||
ano = input.nextInt();
|
||||
input.nextLine();} //buffer clear
|
||||
input.nextLine(); //buffer clear
|
||||
if (ano < 0) {return Erro.E11;}}
|
||||
|
||||
Aluno aluno = new Aluno(nome, idade, local, curso, matricula, semestre, ano, false);
|
||||
this.dados.appendAluno(aluno);
|
||||
String msg = this.dados.appendAluno(aluno);
|
||||
|
||||
System.out.println("O aluno é bolsista? (s/n)");
|
||||
System.out.println("O aluno eh bolsista? (s/n)");
|
||||
String resposta = input.nextLine().toLowerCase();
|
||||
|
||||
if (resposta.equals("s")){
|
||||
return cadastrarBolsista(true, aluno);
|
||||
}
|
||||
|
||||
return "Aluno cadastrado com sucesso.";
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
public String cadastrarBolsista(boolean resposta, Aluno alunoparametro) {
|
||||
|
||||
String projeto = "", orientador = "";
|
||||
Aluno aluno;
|
||||
|
||||
if (resposta){
|
||||
aluno = alunoparametro;
|
||||
} else {
|
||||
System.out.println("Insira o nome do aluno a quem você deseja cadastrar uma bolsa:");
|
||||
aluno = this.dados.findAluno(input.nextLine());
|
||||
if (aluno == null)
|
||||
return Erro.E2;
|
||||
}
|
||||
} else {
|
||||
System.out.println("Insira o nome do aluno a quem voce deseja cadastrar uma bolsa:");
|
||||
aluno = this.dados.findAluno(input.nextLine());
|
||||
|
||||
while (projeto.length() == 0){
|
||||
if (aluno == null) {return Erro.E2;}
|
||||
}
|
||||
|
||||
while (projeto.length() == 0){// Repete a pergunta até que uma resposta seja digitada
|
||||
System.out.println("Insira o nome do projeto:");
|
||||
String projeto = input.nextLine();}
|
||||
projeto = input.nextLine();}
|
||||
|
||||
while (orientador.length() == 0){
|
||||
while (orientador.length() == 0){// Repete a pergunta até que uma resposta seja digitada
|
||||
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);
|
||||
return this.dados.appendBolsista(bolsista);
|
||||
|
||||
return this.dados.appendBolsista(bolsista);
|
||||
}
|
||||
|
||||
public String registrarAcompanhamento() {
|
||||
System.out.println("Insira o nome do Aluno que você deseja registrar o acompanhamento:");
|
||||
System.out.println("Insira o nome do Aluno que voce deseja registrar o acompanhamento:");
|
||||
String nome = input.nextLine();
|
||||
Aluno aluno = this.dados.findAluno(nome);
|
||||
|
||||
if (aluno == null)
|
||||
return Erro.E2;
|
||||
|
||||
Acompanhamento acomp = new Acompanhamento(aluno, 0, 0, 0, 0, 0);
|
||||
|
||||
if (aluno == null) {return Erro.E2;}
|
||||
|
||||
System.out.println("Insira a quantidade de atividades entregues:");
|
||||
int entregues = input.nextInt();
|
||||
input.nextLine(); //buffer clear
|
||||
acomp.setAtividadesEntregues(entregues);
|
||||
|
||||
if (entregues < 0) {return Erro.E11;}
|
||||
|
||||
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;
|
||||
if (ia < 0) {return Erro.E11;}
|
||||
|
||||
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;
|
||||
if (explicadas < 0) {return Erro.E11;}
|
||||
|
||||
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;
|
||||
if (semajuda < 0) {return Erro.E11;}
|
||||
|
||||
System.out.println("Insira a quanntidade de atividades entregues que utilizarão estruturas não estudadas:");
|
||||
System.out.println("Insira a quantidade de atividades entregues que utilizaram estruturas não estudadas:");
|
||||
int naoestudadas = input.nextInt();
|
||||
input.nextLine(); //buffer clear
|
||||
if (acomp.setAtividadesNaoEstudadas(naoestudadas))
|
||||
if (naoestudadas < 0) {return Erro.E11;}
|
||||
|
||||
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() {
|
||||
|
|
@ -152,12 +146,15 @@ public class Gerenciador {
|
|||
public String percentualAlunos() {
|
||||
String curso = "";
|
||||
|
||||
while (curso.length() == 0){
|
||||
while (curso.length() == 0){// Repete a pergunta até que uma resposta seja digitada
|
||||
System.out.println("Insira um curso:");
|
||||
curso = input.nextLine();
|
||||
}
|
||||
|
||||
return "O percentual de alunos matriculados nesse curso é de: " + this.dados.coursePercent(curso) + "%";
|
||||
double porcentagem = this.dados.coursePercent(curso);
|
||||
if (porcentagem == -1) {return Erro.E5;}
|
||||
|
||||
return "O percentual de alunos matriculados nesse curso eh de: " + porcentagem + "%";
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -168,8 +165,7 @@ public class Gerenciador {
|
|||
public String criarChamada() {
|
||||
this.dados.makeChamada();
|
||||
|
||||
if (chamada().equals(Erro.E5))
|
||||
return chamada();
|
||||
if (this.dados.getChamada().length() == 0) {return Erro.E5;}
|
||||
|
||||
return "Chamada criada com sucesso.";
|
||||
}
|
||||
|
|
@ -179,20 +175,16 @@ public class Gerenciador {
|
|||
}
|
||||
|
||||
public String calcularRisco() {
|
||||
|
||||
System.out.println("Insira o nome de um aluno:");
|
||||
Acompanhamento acomp = this.dados.findAcompanhamento(input.nextLine());
|
||||
if (acomp == null)
|
||||
return Erro.E2;
|
||||
|
||||
if (acomp == null) {return Erro.E10;}
|
||||
|
||||
return acomp.getRiscoLabel();
|
||||
|
||||
}
|
||||
|
||||
public String relatorioRisco() {
|
||||
|
||||
return this.dados.riskReport();
|
||||
|
||||
}
|
||||
|
||||
public String altoRisco() {
|
||||
|
|
@ -200,6 +192,6 @@ public class Gerenciador {
|
|||
}
|
||||
|
||||
public String inovacao() {
|
||||
return null;
|
||||
return dados.rankingRisco();
|
||||
}
|
||||
}
|
||||
27
Menu.java
27
Menu.java
|
|
@ -1,24 +1,24 @@
|
|||
// TODO: atualizar README.md
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Menu {
|
||||
|
||||
private static Dados dados;
|
||||
private static Gerenciador gerenciador;
|
||||
private static Scanner input;
|
||||
private static String result;
|
||||
|
||||
public static void main(String[] args) {
|
||||
dados = new Dados();
|
||||
gerenciador = new Gerenciador(dados);
|
||||
input = new Scanner(System.in);
|
||||
result = "";
|
||||
|
||||
Scanner input = new Scanner(System.in);
|
||||
String result = "";
|
||||
while (true) {
|
||||
System.out.println(
|
||||
"\fEscolha uma opcao:" + "\n" +
|
||||
"1 - Cadastro de Aluno" + "\n" +
|
||||
"2 - Cadastro de Bolsisa " + "\n" +
|
||||
"3 - Regisrar dados de acompanhamento" + "\n" +
|
||||
"2 - Cadastro de Bolsista " + "\n" +
|
||||
"3 - Registrar dados de acompanhamento" + "\n" +
|
||||
"4 - Listar alunos" + "\n" +
|
||||
"5 - Listar alunos bolsistas" + "\n" +
|
||||
"6 - Nome mais longo de alunos cadastrados" + "\n" +
|
||||
|
|
@ -30,11 +30,16 @@ public class Menu {
|
|||
"12 - Calcular nivel de risco pedagogico" + "\n" +
|
||||
"13 - Relatorio geral de risco pedagogico" + "\n" +
|
||||
"14 - Alunos em alto risco" + "\n" +
|
||||
"15 - (Colocar inovacao aqui)" + "\n" +
|
||||
"15 - Ranking e media de risco" + "\n" +
|
||||
"16 - Encerrar o programa\n\n" +
|
||||
|
||||
result);
|
||||
|
||||
result = prompt(input.nextInt());
|
||||
try {
|
||||
result = prompt(input.nextInt());
|
||||
} catch(Exception e) {
|
||||
result = Erro.E0 + e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -68,12 +73,12 @@ public class Menu {
|
|||
return gerenciador.relatorioRisco();
|
||||
case 14:
|
||||
return gerenciador.altoRisco();
|
||||
// TODO: IMPLEMENTAR INOVAÇÃO
|
||||
case 15:
|
||||
return gerenciador.inovacao();
|
||||
case 16:
|
||||
System.exit(0);
|
||||
default:
|
||||
return Erro.E1;
|
||||
}
|
||||
return Erro.E1;
|
||||
}
|
||||
}
|
||||
}
|
||||
95
README.md
95
README.md
|
|
@ -1,95 +0,0 @@
|
|||
# Trabalho final de fundamentos
|
||||
|
||||
---
|
||||
|
||||
TITULO DO PROJETO: TF
|
||||
|
||||
PROPOSITO DO PROJETO: A partir da escolha do usuario, o programa executa o metodo respectivo da escolha, com o projeto sendo um conjunto de metodos que(CONTINUAR)
|
||||
|
||||
COMO COMECAR O PROJETO: Inicialize o projeto clicando com o botao direito na classe Menu e selecionando o metodo main.
|
||||
|
||||
AUTORES: Caio Persch Espindola (26102478), Gabriel Franco (26102988), Arthur Dietrich de Morais (26106328)
|
||||
|
||||
---
|
||||
OK--
|
||||
INSTRUCOES PARA USUARIO:
|
||||
Esscolha uma opcao do menu digitando o numero correspondente:
|
||||
|
||||
1 - Cadastrar um aluno
|
||||
2 - Cadastrar um bolsista
|
||||
3 - Registrar dados de acompanhamento
|
||||
4 - Listar alunos
|
||||
5 - Listar bolsistas
|
||||
6 - Aluno com maior nome
|
||||
7 - Total de vogais
|
||||
8 - Calcular percentual dos alunos
|
||||
9 - Calcular media de idade dos alunos
|
||||
10 - Criar/Atualizar lista de chamada
|
||||
11 - Lista de chamada
|
||||
12 - Calculo do risco pedagogico
|
||||
13 - Relatorio geral do risco pedagogico
|
||||
14 - Mostrar alunos em alto risco
|
||||
15 - (Inovacao)
|
||||
16 - Encerrar o programa
|
||||
|
||||
Ao inserir qual das 16 ações possiveis o usuario deseja realizar, os metodos apropriados são chamados, das classes Acompanhamento ou Aluno. Depois, o programa retornara para o menu, ate o usuario escolher sair.
|
||||
Voce pode criar quantos Alunos, Bolsistas, Listas, etc, que voce dsejar sem precisar reiniciar o programa.
|
||||
|
||||
---
|
||||
|
||||
COMO O PROGRAMA FUNCIONA:
|
||||
O sistema é constituido por 5 classes: Pessoa, Aluno, Bolsista, Acompanhamento e Menu. O método main se localiza na classe Menu e, quando chamado, passa a receber informações do usuário por meio de um loop while e um switch case.
|
||||
Apos o input do usuario um dos metodos sera "rodado".
|
||||
|
||||
Explicacao dos metodos:
|
||||
|
||||
|
||||
---
|
||||
|
||||
VERSION CONTROL:
|
||||
1.0
|
||||
Feito pelos 3 membros juntos.
|
||||
Cada um fez uma parte inicial do projeto.
|
||||
|
||||
|
||||
---
|
||||
|
||||
REFERENCIAS:
|
||||
Nao utilizamos referencias durante a producao do trabalho.
|
||||
|
||||
RELATORIO:
|
||||
Os questionamentos que surgiram durante a programacao foram discutidas por todos entre o grupo.
|
||||
Conceitos apredidos durante o andamento de todo o semestre foram muito reforcados.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
----
|
||||
Texto antigo:
|
||||
|
||||
O sistema é constituido por 5 classes: Pessoa, Aluno, Bolsista, Acompanhamento e Menu. O método main se localiza na classe Menu e, quando chamado, passa a receber informações do usuário por meio de um loop while e um switch case.
|
||||
Ao inserir qual das 16 ações possiveis o usuario deseja realizar, os metodos apropriados são chamados, das classes Acompanhamento ou Aluno.
|
||||
A relação entre as classes Pessoa, Aluno e Bolsista é de composição. Uma instancia de Bolsista possui um atributo do tipo Aluno, o qual possui um atributo do tipo Pessoa.
|
||||
Um objeto da classe Acompanhamento possui uma instancia da classe Aluno, alem de varias variáveis que representam os diferente tipos de atividades entregues. A partir desses dados, o risco pedagógico é calculado como sendo a média aritmética entre as porcentagens de atividades feitas com IA, não explicadas, feitas com ajuda, e que utilizam funcionalidades não estudadas.
|
||||
Loading…
Reference in a new issue