Versao Final
This commit is contained in:
parent
ea48ef7541
commit
e2ca24a21d
5 changed files with 158 additions and 114 deletions
|
|
@ -8,7 +8,6 @@ public class Acompanhamento {
|
||||||
private double riscoPedagogico;
|
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.aluno = aluno;
|
||||||
this.atividadesEntregues = atividadesEntregues;
|
this.atividadesEntregues = atividadesEntregues;
|
||||||
this.atividadesIA = atividadesIA;
|
this.atividadesIA = atividadesIA;
|
||||||
|
|
@ -37,13 +36,13 @@ public class Acompanhamento {
|
||||||
this.riscoPedagogico = this.calcularRisco();
|
this.riscoPedagogico = this.calcularRisco();
|
||||||
|
|
||||||
if (this.riscoPedagogico <= 3.3){
|
if (this.riscoPedagogico <= 3.3){
|
||||||
return "O risco pedagógico deste aluno é BAIXO";
|
return "O risco pedagogico deste aluno eh BAIXO";
|
||||||
}
|
}
|
||||||
if (this.riscoPedagogico > 3.3 && this.riscoPedagogico < 6.6){
|
if (this.riscoPedagogico > 3.3 && this.riscoPedagogico < 6.6){
|
||||||
return "O risco pedagógico deste aluno é MODERADO";
|
return "O risco pedagogico deste aluno eh MODERADO";
|
||||||
}
|
}
|
||||||
if (this.riscoPedagogico >= 6.6){
|
if (this.riscoPedagogico >= 6.6){
|
||||||
return "O risco pedagógico deste aluno é ALTO";
|
return "O risco pedagogico deste aluno eh ALTO";
|
||||||
}
|
}
|
||||||
|
|
||||||
return Erro.E7;
|
return Erro.E7;
|
||||||
|
|
|
||||||
133
Dados.java
133
Dados.java
|
|
@ -1,5 +1,3 @@
|
||||||
// TODO: acentos no isVowel()
|
|
||||||
|
|
||||||
public class Dados {
|
public class Dados {
|
||||||
private Aluno[] alunos;
|
private Aluno[] alunos;
|
||||||
private String chamada;
|
private String chamada;
|
||||||
|
|
@ -14,9 +12,7 @@ public class Dados {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String appendAluno(Aluno aluno){
|
public String appendAluno(Aluno aluno){
|
||||||
if (checkDuplicate(aluno.getNome())){
|
if (checkDuplicate(aluno.getNome())) {return Erro.E3;}
|
||||||
return Erro.E3;
|
|
||||||
}
|
|
||||||
|
|
||||||
int size = this.alunos.length;
|
int size = this.alunos.length;
|
||||||
|
|
||||||
|
|
@ -33,7 +29,6 @@ public class Dados {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String appendAcompanhamento(Acompanhamento acomp){
|
public String appendAcompanhamento(Acompanhamento acomp){
|
||||||
|
|
||||||
int index = findAcompanhamentoIndex(acomp.getAluno().getNome());
|
int index = findAcompanhamentoIndex(acomp.getAluno().getNome());
|
||||||
|
|
||||||
if (index != -1){
|
if (index != -1){
|
||||||
|
|
@ -60,10 +55,17 @@ public class Dados {
|
||||||
if (nome.equals(acompanhamentos[i].getAluno().getNome()))
|
if (nome.equals(acompanhamentos[i].getAluno().getNome()))
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String appendBolsista(Bolsista bolsista){
|
public String appendBolsista(Bolsista bolsista){
|
||||||
|
int index = findBolsistaIndex(bolsista.getNome());
|
||||||
|
|
||||||
|
if (index != -1){
|
||||||
|
bolsistas[index] = bolsista;
|
||||||
|
return "Bolsista atualizado com sucesso.";
|
||||||
|
}
|
||||||
|
|
||||||
int size = this.bolsistas.length;
|
int size = this.bolsistas.length;
|
||||||
|
|
||||||
|
|
@ -94,31 +96,35 @@ public class Dados {
|
||||||
if (nome.equals(alunos[i].getNome()))
|
if (nome.equals(alunos[i].getNome()))
|
||||||
return i;
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Aluno findAluno(String nome){
|
public Aluno findAluno(String nome){
|
||||||
int index = findAlunoIndex(nome);
|
int index = findAlunoIndex(nome);
|
||||||
|
|
||||||
if (index == -1){
|
if (index == -1) {return null;}
|
||||||
return null;
|
else {return alunos[index];}
|
||||||
}
|
|
||||||
|
|
||||||
return alunos[index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Acompanhamento findAcompanhamento(String nome){
|
public Acompanhamento findAcompanhamento(String nome){
|
||||||
int index = findAcompanhamentoIndex(nome);
|
int index = findAcompanhamentoIndex(nome);
|
||||||
|
|
||||||
if (index == -1)
|
if (index == -1) {return null;}
|
||||||
return null;
|
else {return acompanhamentos[index];}
|
||||||
|
|
||||||
return acompanhamentos[index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String listAlunos(){
|
public String listAlunos(){
|
||||||
if (alunos.length == 0)
|
if (alunos.length == 0) {return Erro.E5;}
|
||||||
return Erro.E5;
|
|
||||||
|
|
||||||
String lista = "";
|
String lista = "";
|
||||||
for (int i = 0; i < alunos.length; i++){
|
for (int i = 0; i < alunos.length; i++){
|
||||||
|
|
@ -129,8 +135,7 @@ public class Dados {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String listBolsistas(){
|
public String listBolsistas(){
|
||||||
if (bolsistas.length == 0)
|
if (bolsistas.length == 0) {return Erro.E5;}
|
||||||
return Erro.E5;
|
|
||||||
|
|
||||||
String lista = "";
|
String lista = "";
|
||||||
for (int i = 0; i < bolsistas.length; i++){
|
for (int i = 0; i < bolsistas.length; i++){
|
||||||
|
|
@ -141,8 +146,7 @@ public class Dados {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String riskReport(){
|
public String riskReport(){
|
||||||
if (acompanhamentos.length == 0)
|
if (acompanhamentos.length == 0) {return Erro.E8;}
|
||||||
return Erro.E8;
|
|
||||||
|
|
||||||
String relatorio = "";
|
String relatorio = "";
|
||||||
|
|
||||||
|
|
@ -152,12 +156,10 @@ public class Dados {
|
||||||
}
|
}
|
||||||
|
|
||||||
return relatorio;
|
return relatorio;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String riskReportHigh(){
|
public String riskReportHigh(){
|
||||||
if (acompanhamentos.length == 0)
|
if (acompanhamentos.length == 0) {return Erro.E8;}
|
||||||
return Erro.E8;
|
|
||||||
|
|
||||||
String relatorio = "";
|
String relatorio = "";
|
||||||
|
|
||||||
|
|
@ -167,29 +169,27 @@ public class Dados {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (relatorio.length() == 0)
|
if (relatorio.length() == 0) {return Erro.E9;}
|
||||||
return Erro.E9;
|
|
||||||
|
|
||||||
return relatorio;
|
return relatorio;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String maiorNome(){
|
public String maiorNome(){
|
||||||
if (alunos.length == 0)
|
if (alunos.length == 0) {return Erro.E5;}
|
||||||
return Erro.E5;
|
|
||||||
if (alunos.length == 1)
|
if (alunos.length == 1) {return alunos[0].getNome();}
|
||||||
return alunos[0].getNome();
|
|
||||||
|
|
||||||
int k = 0;
|
int k = 0;
|
||||||
for (int i = 1; i < alunos.length; i++){
|
for (int i = 1; i < alunos.length; i++){
|
||||||
if (alunos[i].getNome().length() > alunos[k].getNome().length())
|
if (alunos[i].getNome().length() > alunos[k].getNome().length())
|
||||||
k = i;
|
k = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
return alunos[k].getNome();
|
return alunos[k].getNome();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String averageAge(){
|
public String averageAge(){
|
||||||
if (alunos.length == 0)
|
if (alunos.length == 0) {return Erro.E5;}
|
||||||
return Erro.E5;
|
|
||||||
|
|
||||||
double sum = 0;
|
double sum = 0;
|
||||||
|
|
||||||
|
|
@ -198,12 +198,11 @@ public class Dados {
|
||||||
}
|
}
|
||||||
|
|
||||||
sum = sum / alunos.length;
|
sum = sum / alunos.length;
|
||||||
return "Idade média dos alunos: " + sum;
|
return "Idade media dos alunos: " + sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String totalVowels(){
|
public String totalVowels(){
|
||||||
if (alunos.length == 0)
|
if (alunos.length == 0) {return Erro.E5;}
|
||||||
return Erro.E5;
|
|
||||||
|
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|
||||||
|
|
@ -216,38 +215,35 @@ public class Dados {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return "Numero total de vogais:" + sum;
|
return "Numero total de vogais:" + sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isVowel(char a){
|
private boolean isVowel(char a){
|
||||||
|
return (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');
|
|| (a == 'A') || (a == 'E') || (a == 'I') || (a == 'O') || (a == 'U');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void makeChamada(){
|
public void makeChamada(){
|
||||||
this.chamada = "";
|
this.chamada = "";
|
||||||
|
|
||||||
if (alunos.length == 0){
|
if (alunos.length == 0) {return;}
|
||||||
this.chamada = Erro.E5;
|
|
||||||
} else {
|
for (int i = 0; i < alunos.length; i++){
|
||||||
for (int i = 0; i < alunos.length; i++){
|
this.chamada = this.chamada.concat(alunos[i].getMatricula() + " / ");
|
||||||
this.chamada = this.chamada.concat(alunos[i].getMatricula() + " / ");
|
this.chamada = this.chamada.concat(alunos[i].getNome() + " / ");
|
||||||
this.chamada = this.chamada.concat(alunos[i].getNome() + " / ");
|
this.chamada = this.chamada.concat(alunos[i].getCurso() + "\n");
|
||||||
this.chamada = this.chamada.concat(alunos[i].getCurso() + "\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String printChamada(){
|
public String printChamada(){
|
||||||
if (chamada.length() == 0)
|
if (chamada.length() == 0) {return Erro.E6;}
|
||||||
return Erro.E6;
|
|
||||||
|
|
||||||
return chamada;
|
return chamada;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double coursePercent(String curso){
|
public double coursePercent(String curso){
|
||||||
|
if (alunos.length == 0) {return -1;}
|
||||||
|
|
||||||
double num = 0;
|
double num = 0;
|
||||||
|
|
||||||
for (int i = 0; i < alunos.length; i++){
|
for (int i = 0; i < alunos.length; i++){
|
||||||
|
|
@ -257,4 +253,43 @@ public class Dados {
|
||||||
|
|
||||||
return (num / alunos.length) * 100;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
Erro.java
20
Erro.java
|
|
@ -1,12 +1,14 @@
|
||||||
public class Erro {
|
public class Erro {
|
||||||
public static final String E1 = "Erro: Opção do menu inválida.";
|
public static final String E0 = "Erro: Um erro inesperado ocorreu.";
|
||||||
public static final String E2 = "Erro: Aluno não encontrado.";
|
public static final String E1 = "Erro: Opcao do menu invalida.";
|
||||||
public static final String E3 = "Erro: Já existe um aluno com esse nome.";
|
public static final String E2 = "Erro: Aluno nao encontrado.";
|
||||||
public static final String E4 = "Erro: Você inseriu numeros inválidos de atividades.";
|
public static final String E3 = "Erro: Ja existe um aluno com esse nome.";
|
||||||
public static final String E5 = "Erro: Não existem alunos cadastrados.";
|
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 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 E7 = "Erro: Nao foi possivel calcular o risco pedagogico.";
|
||||||
public static final String E8 = "Erro: Não existem acompanhamentos cadastrados.";
|
public static final String E8 = "Erro: Nao existem acompanhamentos cadastrados.";
|
||||||
public static final String E9 = "Erro: Não existe nenhum aluno com risco alto.";
|
public static final String E9 = "Erro: Nao existe nenhum aluno com risco alto.";
|
||||||
public static final String E10 = "Erro: Acompanhamento não encontrado.";
|
public static final String E10 = "Erro: Acompanhamento nao encontrado.";
|
||||||
|
public static final String E11 = "Errro: Voce inseriu um dado invalido.";
|
||||||
}
|
}
|
||||||
|
|
@ -4,8 +4,6 @@ public class Gerenciador {
|
||||||
private Dados dados;
|
private Dados dados;
|
||||||
private static Scanner input = new Scanner(System.in);
|
private static Scanner input = new Scanner(System.in);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Gerenciador(Dados dados) {
|
public Gerenciador(Dados dados) {
|
||||||
this.dados = dados;
|
this.dados = dados;
|
||||||
}
|
}
|
||||||
|
|
@ -23,8 +21,8 @@ public class Gerenciador {
|
||||||
local = input.nextLine();}
|
local = input.nextLine();}
|
||||||
|
|
||||||
while (curso.length() == 0){
|
while (curso.length() == 0){
|
||||||
System.out.println("Insira o curso do aluno:");
|
System.out.println("Insira o curso do aluno:");
|
||||||
curso = input.nextLine();}
|
curso = input.nextLine();}
|
||||||
|
|
||||||
while (matricula.length() == 0){
|
while (matricula.length() == 0){
|
||||||
System.out.println("Insira a matricula do aluno:");
|
System.out.println("Insira a matricula do aluno:");
|
||||||
|
|
@ -33,44 +31,46 @@ public class Gerenciador {
|
||||||
while (idade == 0 ){
|
while (idade == 0 ){
|
||||||
System.out.println("Insira a idade do aluno:");
|
System.out.println("Insira a idade do aluno:");
|
||||||
idade = input.nextInt();
|
idade = input.nextInt();
|
||||||
input.nextLine();} //buffer clear
|
input.nextLine(); //buffer clear
|
||||||
|
if (idade < 0) {return Erro.E11;}}
|
||||||
|
|
||||||
while (semestre == 0){
|
while (semestre == 0){
|
||||||
System.out.println("Insira o semestre do aluno:");
|
System.out.println("Insira o semestre do aluno:");
|
||||||
semestre = input.nextInt();
|
semestre = input.nextInt();
|
||||||
input.nextLine();} //buffer clear
|
input.nextLine(); //buffer clear
|
||||||
|
if (semestre < 0) {return Erro.E11;}}
|
||||||
|
|
||||||
while (ano == 0){
|
while (ano == 0){
|
||||||
System.out.println("Insira o ano do aluno:");
|
System.out.println("Insira o ano do aluno:");
|
||||||
ano = input.nextInt();
|
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);
|
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();
|
String resposta = input.nextLine().toLowerCase();
|
||||||
|
|
||||||
if (resposta.equals("s")){
|
if (resposta.equals("s")){
|
||||||
return cadastrarBolsista(true, aluno);
|
return cadastrarBolsista(true, aluno);
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Aluno cadastrado com sucesso.";
|
return msg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String cadastrarBolsista(boolean resposta, Aluno alunoparametro) {
|
public String cadastrarBolsista(boolean resposta, Aluno alunoparametro) {
|
||||||
String projeto = "", orientador = "";
|
String projeto = "", orientador = "";
|
||||||
|
|
||||||
Aluno aluno;
|
Aluno aluno;
|
||||||
|
|
||||||
if (resposta){
|
if (resposta){
|
||||||
aluno = alunoparametro;
|
aluno = alunoparametro;
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Insira o nome do aluno a quem você deseja cadastrar uma bolsa:");
|
System.out.println("Insira o nome do aluno a quem voce deseja cadastrar uma bolsa:");
|
||||||
aluno = this.dados.findAluno(input.nextLine());
|
aluno = this.dados.findAluno(input.nextLine());
|
||||||
if (aluno == null)
|
|
||||||
return Erro.E2;
|
if (aluno == null) {return Erro.E2;}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (projeto.length() == 0){
|
while (projeto.length() == 0){
|
||||||
System.out.println("Insira o nome do projeto:");
|
System.out.println("Insira o nome do projeto:");
|
||||||
|
|
@ -82,37 +82,41 @@ public class Gerenciador {
|
||||||
|
|
||||||
Bolsista bolsista = new Bolsista(aluno, projeto, orientador);
|
Bolsista bolsista = new Bolsista(aluno, projeto, orientador);
|
||||||
aluno.setBolsista(true);
|
aluno.setBolsista(true);
|
||||||
return this.dados.appendBolsista(bolsista);
|
|
||||||
|
|
||||||
|
return this.dados.appendBolsista(bolsista);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String registrarAcompanhamento() {
|
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();
|
String nome = input.nextLine();
|
||||||
Aluno aluno = this.dados.findAluno(nome);
|
Aluno aluno = this.dados.findAluno(nome);
|
||||||
|
|
||||||
if (aluno == null)
|
if (aluno == null) {return Erro.E2;}
|
||||||
return Erro.E2;
|
|
||||||
|
|
||||||
System.out.println("Insira a quantidade de atividades entregues:");
|
System.out.println("Insira a quantidade de atividades entregues:");
|
||||||
int entregues = input.nextInt();
|
int entregues = input.nextInt();
|
||||||
input.nextLine(); //buffer clear
|
input.nextLine(); //buffer clear
|
||||||
|
if (entregues < 0) {return Erro.E11;}
|
||||||
|
|
||||||
System.out.println("Insira a quantidade de atividades entregues nas quais foi declarado o uso de IA:");
|
System.out.println("Insira a quantidade de atividades entregues nas quais foi declarado o uso de IA:");
|
||||||
int ia = input.nextInt();
|
int ia = input.nextInt();
|
||||||
input.nextLine(); //buffer clear
|
input.nextLine(); //buffer clear
|
||||||
|
if (ia < 0) {return Erro.E11;}
|
||||||
|
|
||||||
System.out.println("Insira a quantidade de atividades entregues que o aluno soube explicar:");
|
System.out.println("Insira a quantidade de atividades entregues que o aluno soube explicar:");
|
||||||
int explicadas = input.nextInt();
|
int explicadas = input.nextInt();
|
||||||
input.nextLine(); //buffer clear
|
input.nextLine(); //buffer clear
|
||||||
|
if (explicadas < 0) {return Erro.E11;}
|
||||||
|
|
||||||
System.out.println("Insira a quantidade de atividades entregues que foram feitas sem ajuda:");
|
System.out.println("Insira a quantidade de atividades entregues que foram feitas sem ajuda:");
|
||||||
int semajuda = input.nextInt();
|
int semajuda = input.nextInt();
|
||||||
input.nextLine(); //buffer clear
|
input.nextLine(); //buffer clear
|
||||||
|
if (semajuda < 0) {return Erro.E11;}
|
||||||
|
|
||||||
System.out.println("Insira a quanntidade de atividades entregues que utilizaram estruturas não estudadas:");
|
System.out.println("Insira a quanntidade de atividades entregues que utilizaram estruturas não estudadas:");
|
||||||
int naoestudadas = input.nextInt();
|
int naoestudadas = input.nextInt();
|
||||||
input.nextLine(); //buffer clear
|
input.nextLine(); //buffer clear
|
||||||
|
if (naoestudadas < 0) {return Erro.E11;}
|
||||||
|
|
||||||
if (ia > entregues || explicadas > entregues || semajuda > entregues || naoestudadas > entregues){
|
if (ia > entregues || explicadas > entregues || semajuda > entregues || naoestudadas > entregues){
|
||||||
return Erro.E4;
|
return Erro.E4;
|
||||||
|
|
@ -147,7 +151,10 @@ public class Gerenciador {
|
||||||
curso = input.nextLine();
|
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 + "%";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -158,8 +165,7 @@ public class Gerenciador {
|
||||||
public String criarChamada() {
|
public String criarChamada() {
|
||||||
this.dados.makeChamada();
|
this.dados.makeChamada();
|
||||||
|
|
||||||
if (chamada().equals(Erro.E5))
|
if (chamada().length() == 0) {return Erro.E5;}
|
||||||
return chamada();
|
|
||||||
|
|
||||||
return "Chamada criada com sucesso.";
|
return "Chamada criada com sucesso.";
|
||||||
}
|
}
|
||||||
|
|
@ -169,20 +175,16 @@ public class Gerenciador {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String calcularRisco() {
|
public String calcularRisco() {
|
||||||
|
|
||||||
System.out.println("Insira o nome de um aluno:");
|
System.out.println("Insira o nome de um aluno:");
|
||||||
Acompanhamento acomp = this.dados.findAcompanhamento(input.nextLine());
|
Acompanhamento acomp = this.dados.findAcompanhamento(input.nextLine());
|
||||||
if (acomp == null)
|
|
||||||
return Erro.E10;
|
if (acomp == null) {return Erro.E10;}
|
||||||
|
|
||||||
return acomp.getRiscoLabel();
|
return acomp.getRiscoLabel();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String relatorioRisco() {
|
public String relatorioRisco() {
|
||||||
|
|
||||||
return this.dados.riskReport();
|
return this.dados.riskReport();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String altoRisco() {
|
public String altoRisco() {
|
||||||
|
|
@ -190,6 +192,6 @@ public class Gerenciador {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String inovacao() {
|
public String inovacao() {
|
||||||
return null;
|
return dados.rankingRisco();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
22
Menu.java
22
Menu.java
|
|
@ -1,18 +1,18 @@
|
||||||
// TODO: atualizar README.md
|
|
||||||
|
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class Menu {
|
public class Menu {
|
||||||
|
|
||||||
private static Dados dados;
|
private static Dados dados;
|
||||||
private static Gerenciador gerenciador;
|
private static Gerenciador gerenciador;
|
||||||
|
private static Scanner input;
|
||||||
|
private static String result;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
dados = new Dados();
|
dados = new Dados();
|
||||||
gerenciador = new Gerenciador(dados);
|
gerenciador = new Gerenciador(dados);
|
||||||
|
input = new Scanner(System.in);
|
||||||
|
result = "";
|
||||||
|
|
||||||
Scanner input = new Scanner(System.in);
|
|
||||||
String result = "";
|
|
||||||
while (true) {
|
while (true) {
|
||||||
System.out.println(
|
System.out.println(
|
||||||
"\fEscolha uma opcao:" + "\n" +
|
"\fEscolha uma opcao:" + "\n" +
|
||||||
|
|
@ -30,11 +30,17 @@ public class Menu {
|
||||||
"12 - Calcular nivel de risco pedagogico" + "\n" +
|
"12 - Calcular nivel de risco pedagogico" + "\n" +
|
||||||
"13 - Relatorio geral de risco pedagogico" + "\n" +
|
"13 - Relatorio geral de risco pedagogico" + "\n" +
|
||||||
"14 - Alunos em alto risco" + "\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" +
|
"16 - Encerrar o programa\n\n" +
|
||||||
|
|
||||||
result);
|
result);
|
||||||
|
|
||||||
result = prompt(input.nextInt());
|
try {
|
||||||
|
result = prompt(input.nextInt());
|
||||||
|
} catch(Exception e) {
|
||||||
|
System.out.println("\f"+ Erro.E0);
|
||||||
|
System.exit(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,12 +74,12 @@ public class Menu {
|
||||||
return gerenciador.relatorioRisco();
|
return gerenciador.relatorioRisco();
|
||||||
case 14:
|
case 14:
|
||||||
return gerenciador.altoRisco();
|
return gerenciador.altoRisco();
|
||||||
// TODO: IMPLEMENTAR INOVAÇÃO
|
|
||||||
case 15:
|
case 15:
|
||||||
return gerenciador.inovacao();
|
return gerenciador.inovacao();
|
||||||
case 16:
|
case 16:
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
|
default:
|
||||||
|
return Erro.E1;
|
||||||
}
|
}
|
||||||
return Erro.E1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue