commit
d19f0ebc4e
5 changed files with 240 additions and 140 deletions
|
|
@ -35,12 +35,15 @@ public class Acompanhamento {
|
||||||
public String getRiscoLabel() {
|
public String getRiscoLabel() {
|
||||||
this.calcularRisco();
|
this.calcularRisco();
|
||||||
if (riscoPedagogico <= 3.3) {
|
if (riscoPedagogico <= 3.3) {
|
||||||
return "BAIXO";
|
return "O risco pedagógico deste aluno é BAIXO";
|
||||||
}
|
}
|
||||||
if (riscoPedagogico > 3.3 && riscoPedagogico < 6.6) {
|
if (riscoPedagogico > 3.3 && riscoPedagogico < 6.6) {
|
||||||
return "MODERADO";
|
return "O risco pedagógico deste aluno é MODERADO";
|
||||||
}
|
}
|
||||||
return "ALTO";
|
if (riscoPedagogico >= 6.6) {
|
||||||
|
return "O risco pedagógico deste aluno é ALTO";
|
||||||
|
}
|
||||||
|
return Erro.E7;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Aluno getAluno() {
|
public Aluno getAluno() {
|
||||||
|
|
@ -55,31 +58,35 @@ public class Acompanhamento {
|
||||||
this.atividadesEntregues = atividadesEntregues;
|
this.atividadesEntregues = atividadesEntregues;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAtividadesIA(int atividadesIA) {
|
public boolean setAtividadesIA(int atividadesIA) {
|
||||||
if (atividadesIA > atividadesEntregues) {
|
if (atividadesIA > atividadesEntregues) {
|
||||||
System.out.println("AVISO: Você escolheu um número maior do que o total de atividades entregues.");
|
return true;
|
||||||
}
|
}
|
||||||
this.atividadesIA = atividadesIA;
|
this.atividadesIA = atividadesIA;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAtividadesExplicadas(int atividadesExplicadas) {
|
public boolean setAtividadesExplicadas(int atividadesExplicadas) {
|
||||||
if (atividadesExplicadas > atividadesEntregues) {
|
if (atividadesExplicadas > atividadesEntregues) {
|
||||||
System.out.println("AVISO: Você escolheu um número maior do que o total de atividades entregues.");
|
return true;
|
||||||
}
|
}
|
||||||
this.atividadesExplicadas = atividadesExplicadas;
|
this.atividadesExplicadas = atividadesExplicadas;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAtividadesSemAjuda(int atividadesSemAjuda) {
|
public boolean setAtividadesSemAjuda(int atividadesSemAjuda) {
|
||||||
if (atividadesSemAjuda > atividadesEntregues) {
|
if (atividadesSemAjuda > atividadesEntregues) {
|
||||||
System.out.println("AVISO: Você escolheu um número maior do que o total de atividades entregues.");
|
return true;
|
||||||
}
|
}
|
||||||
this.atividadesSemAjuda = atividadesSemAjuda;
|
this.atividadesSemAjuda = atividadesSemAjuda;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAtividadesNaoEstudadas(int atividadesNaoEstudadas) {
|
public boolean setAtividadesNaoEstudadas(int atividadesNaoEstudadas) {
|
||||||
if (atividadesNaoEstudadas > atividadesEntregues) {
|
if (atividadesNaoEstudadas > atividadesEntregues) {
|
||||||
System.out.println("AVISO: Você escolheu um número maior do que o total de atividades entregues.");
|
return true;
|
||||||
}
|
}
|
||||||
this.atividadesNaoEstudadas = atividadesNaoEstudadas;
|
this.atividadesNaoEstudadas = atividadesNaoEstudadas;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
116
Dados.java
116
Dados.java
|
|
@ -13,7 +13,11 @@ public class Dados {
|
||||||
bolsistas = new Bolsista[]{};
|
bolsistas = new Bolsista[]{};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void appendAluno(Aluno aluno){
|
public String appendAluno(Aluno aluno){
|
||||||
|
if (checkDuplicate(aluno.getNome())){
|
||||||
|
return Erro.E3;
|
||||||
|
}
|
||||||
|
|
||||||
int size = this.alunos.length;
|
int size = this.alunos.length;
|
||||||
|
|
||||||
Aluno[] novoArray = new Aluno[size + 1];
|
Aluno[] novoArray = new Aluno[size + 1];
|
||||||
|
|
@ -24,9 +28,15 @@ public class Dados {
|
||||||
|
|
||||||
novoArray[size] = aluno;
|
novoArray[size] = aluno;
|
||||||
this.alunos = novoArray;
|
this.alunos = novoArray;
|
||||||
|
|
||||||
|
return "Aluno cadastrado com sucesso.";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String appendAcompanhamento(Acompanhamento acomp){
|
||||||
|
if (checkDuplicate(acomp.getAluno().getNome())){
|
||||||
|
return Erro.E3;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void appendAcompanhamento(Acompanhamento acomp){
|
|
||||||
int size = this.acompanhamentos.length;
|
int size = this.acompanhamentos.length;
|
||||||
|
|
||||||
Acompanhamento[] novoArray = new Acompanhamento[size + 1];
|
Acompanhamento[] novoArray = new Acompanhamento[size + 1];
|
||||||
|
|
@ -37,9 +47,15 @@ public class Dados {
|
||||||
|
|
||||||
novoArray[size] = acomp;
|
novoArray[size] = acomp;
|
||||||
this.acompanhamentos = novoArray;
|
this.acompanhamentos = novoArray;
|
||||||
|
|
||||||
|
return "Acompanhamento cadastrado com sucesso.";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String appendBolsista(Bolsista bolsista){
|
||||||
|
if (checkDuplicate(bolsista.getNome())){
|
||||||
|
return Erro.E3;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void appendBolsista(Bolsista bolsista){
|
|
||||||
int size = this.bolsistas.length;
|
int size = this.bolsistas.length;
|
||||||
|
|
||||||
Bolsista[] novoArray = new Bolsista[size + 1];
|
Bolsista[] novoArray = new Bolsista[size + 1];
|
||||||
|
|
@ -51,7 +67,19 @@ public class Dados {
|
||||||
novoArray[size] = bolsista;
|
novoArray[size] = bolsista;
|
||||||
this.bolsistas = novoArray;
|
this.bolsistas = novoArray;
|
||||||
|
|
||||||
|
return "Bolsista cadastrado com sucesso.";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkDuplicate(String nome){
|
||||||
|
for (int i = 0; i < alunos.length; i++){
|
||||||
|
if (nome.equals(alunos[i].getNome())){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int findAlunoIndex(String nome){
|
private int findAlunoIndex(String nome){
|
||||||
|
|
@ -63,7 +91,13 @@ public class Dados {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Aluno findAluno(String nome){
|
public Aluno findAluno(String nome){
|
||||||
return alunos[findAlunoIndex(nome)];
|
int index = findAlunoIndex(nome);
|
||||||
|
|
||||||
|
if (index == -1){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return alunos[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
public Acompanhamento findAcompanhamento(String nome){
|
public Acompanhamento findAcompanhamento(String nome){
|
||||||
|
|
@ -76,20 +110,33 @@ public class Dados {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void listAlunos(){
|
public String listAlunos(){
|
||||||
|
if (alunos.length == 0)
|
||||||
|
return Erro.E5;
|
||||||
|
|
||||||
|
String lista = "";
|
||||||
for (int i = 0; i < alunos.length; i++){
|
for (int i = 0; i < alunos.length; i++){
|
||||||
System.out.println(alunos[i].getNome());
|
lista = lista.concat(alunos[i].getNome() + "\n");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void listBolsistas(){
|
return lista;
|
||||||
for (int i = 0; i < alunos.length; i++){
|
|
||||||
if (alunos[i].getBolsista())
|
|
||||||
System.out.println(alunos[i].getNome());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void riskReport(){
|
public String listBolsistas(){
|
||||||
|
if (bolsistas.length == 0)
|
||||||
|
return Erro.E5;
|
||||||
|
|
||||||
|
String lista = "";
|
||||||
|
for (int i = 0; i < bolsistas.length; i++){
|
||||||
|
lista = lista.concat(bolsistas[i].getNome());
|
||||||
|
}
|
||||||
|
|
||||||
|
return lista;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String riskReport(){
|
||||||
|
if (acompanhamentos.length == 0)
|
||||||
|
return Erro.E8;
|
||||||
|
|
||||||
String relatorio = "";
|
String relatorio = "";
|
||||||
|
|
||||||
|
|
@ -98,11 +145,13 @@ public class Dados {
|
||||||
relatorio = relatorio.concat(acompanhamentos[i].getRiscoLabel() + "\n");
|
relatorio = relatorio.concat(acompanhamentos[i].getRiscoLabel() + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println(relatorio);
|
return relatorio;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void riskReportHigh(){
|
public String riskReportHigh(){
|
||||||
|
if (acompanhamentos.length == 0)
|
||||||
|
return Erro.E8;
|
||||||
|
|
||||||
String relatorio = "";
|
String relatorio = "";
|
||||||
|
|
||||||
|
|
@ -112,19 +161,28 @@ public class Dados {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println(relatorio);
|
if (relatorio.length() == 0)
|
||||||
|
return Erro.E9;
|
||||||
|
|
||||||
|
return relatorio;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void maiorNome(){
|
public String maiorNome(){
|
||||||
|
if (alunos.length == 0)
|
||||||
|
return Erro.E5;
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
System.out.println(alunos[k].getNome());
|
return alunos[k].getNome();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double averageAge(){
|
public String averageAge(){
|
||||||
|
if (alunos.length == 0)
|
||||||
|
return Erro.E5;
|
||||||
|
|
||||||
double sum = 0;
|
double sum = 0;
|
||||||
|
|
||||||
for (int i = 0; i < alunos.length; i++){
|
for (int i = 0; i < alunos.length; i++){
|
||||||
|
|
@ -132,10 +190,12 @@ public class Dados {
|
||||||
}
|
}
|
||||||
|
|
||||||
sum = sum / alunos.length;
|
sum = sum / alunos.length;
|
||||||
return sum;
|
return "Idade média dos alunos: " + sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int totalVowels(){
|
public String totalVowels(){
|
||||||
|
if (alunos.length == 0)
|
||||||
|
return Erro.E5;
|
||||||
|
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|
||||||
|
|
@ -149,7 +209,7 @@ public class Dados {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return sum;
|
return "Numero total de vogais:" + sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isVowel(char a){
|
private boolean isVowel(char a){
|
||||||
|
|
@ -160,15 +220,23 @@ public class Dados {
|
||||||
|
|
||||||
public void makeChamada(){
|
public void makeChamada(){
|
||||||
this.chamada = "";
|
this.chamada = "";
|
||||||
|
|
||||||
|
if (alunos.length == 0){
|
||||||
|
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 void printChamada(){
|
public String printChamada(){
|
||||||
System.out.println(chamada);
|
if (chamada.length() == 0)
|
||||||
|
return Erro.E6;
|
||||||
|
|
||||||
|
return chamada;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double coursePercent(String curso){
|
public double coursePercent(String curso){
|
||||||
|
|
|
||||||
11
Erro.java
Normal file
11
Erro.java
Normal file
|
|
@ -0,0 +1,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 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.";
|
||||||
|
}
|
||||||
126
Gerenciador.java
126
Gerenciador.java
|
|
@ -1,4 +1,4 @@
|
||||||
// TODO: validação nos metodos com entrada
|
// TODO: buffer clears
|
||||||
|
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
|
@ -6,38 +6,45 @@ 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);
|
||||||
|
|
||||||
String nome, local, curso, matricula, projeto, orientador;
|
String nome = "", local = "", curso = "", matricula = "", projeto = "", orientador = "";
|
||||||
int idade, semestre, ano;
|
int idade = 0, semestre = 0, ano = 0;
|
||||||
boolean bolsista;
|
boolean bolsista = false;
|
||||||
|
|
||||||
public Gerenciador(Dados dados) {
|
public Gerenciador(Dados dados) {
|
||||||
this.dados = dados;
|
this.dados = dados;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cadastrarAluno() {
|
public String cadastrarAluno() {
|
||||||
|
while (nome.length() == 0){
|
||||||
System.out.println("Insira o nome do aluno:");
|
System.out.println("Insira o nome do aluno:");
|
||||||
nome = input.nextLine();
|
nome = input.nextLine();}
|
||||||
|
|
||||||
|
while (local.length() == 0){
|
||||||
System.out.println("Insira o local de nascimento do aluno:");
|
System.out.println("Insira o local de nascimento do aluno:");
|
||||||
local = input.nextLine();
|
local = input.nextLine();}
|
||||||
|
|
||||||
|
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){
|
||||||
System.out.println("Insira a matricula do aluno:");
|
System.out.println("Insira a matricula do aluno:");
|
||||||
matricula = input.nextLine();
|
matricula = input.nextLine();}
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
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);
|
this.dados.appendAluno(aluno);
|
||||||
|
|
@ -45,12 +52,14 @@ public class Gerenciador {
|
||||||
System.out.println("O aluno é bolsista? (s/n)");
|
System.out.println("O aluno é bolsista? (s/n)");
|
||||||
String resposta = input.nextLine().toLowerCase();
|
String resposta = input.nextLine().toLowerCase();
|
||||||
if (resposta.equals("s")){
|
if (resposta.equals("s")){
|
||||||
cadastrarBolsista(true, aluno);
|
return cadastrarBolsista(true, aluno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return "Aluno cadastrado com sucesso.";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cadastrarBolsista(boolean resposta, Aluno alunoparametro) {
|
public String cadastrarBolsista(boolean resposta, Aluno alunoparametro) {
|
||||||
|
|
||||||
Aluno aluno;
|
Aluno aluno;
|
||||||
|
|
||||||
|
|
@ -59,25 +68,32 @@ public class Gerenciador {
|
||||||
} 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 você deseja cadastrar uma bolsa:");
|
||||||
aluno = this.dados.findAluno(input.nextLine());
|
aluno = this.dados.findAluno(input.nextLine());
|
||||||
|
if (aluno == null)
|
||||||
|
return Erro.E2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (projeto.length() == 0){
|
||||||
System.out.println("Insira o nome do projeto:");
|
System.out.println("Insira o nome do projeto:");
|
||||||
String projeto = input.nextLine();
|
String projeto = input.nextLine();}
|
||||||
|
|
||||||
|
while (orientador.length() == 0){
|
||||||
System.out.println("Insira o nome do orientador:");
|
System.out.println("Insira o nome do orientador:");
|
||||||
String orientador = input.nextLine();
|
String orientador = input.nextLine();}
|
||||||
|
|
||||||
Bolsista bolsista = new Bolsista(aluno, projeto, orientador);
|
Bolsista bolsista = new Bolsista(aluno, projeto, orientador);
|
||||||
aluno.setBolsista(true);
|
aluno.setBolsista(true);
|
||||||
this.dados.appendBolsista(bolsista);
|
return this.dados.appendBolsista(bolsista);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void 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 você 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)
|
||||||
|
return Erro.E2;
|
||||||
|
|
||||||
Acompanhamento acomp = new Acompanhamento(aluno, 0, 0, 0, 0, 0);
|
Acompanhamento acomp = new Acompanhamento(aluno, 0, 0, 0, 0, 0);
|
||||||
|
|
||||||
System.out.println("Insira a quantidade de atividades entregues:");
|
System.out.println("Insira a quantidade de atividades entregues:");
|
||||||
|
|
@ -88,84 +104,102 @@ public class Gerenciador {
|
||||||
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
|
||||||
acomp.setAtividadesIA(ia);
|
if (acomp.setAtividadesIA(ia))
|
||||||
|
return Erro.E4;
|
||||||
|
|
||||||
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
|
||||||
acomp.setAtividadesExplicadas(explicadas);
|
if (acomp.setAtividadesExplicadas(explicadas))
|
||||||
|
return Erro.E4;
|
||||||
|
|
||||||
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
|
||||||
acomp.setAtividadesSemAjuda(semajuda);
|
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 utilizarão estruturas não estudadas:");
|
||||||
int naoestudadas = input.nextInt();
|
int naoestudadas = input.nextInt();
|
||||||
input.nextLine(); //buffer clear
|
input.nextLine(); //buffer clear
|
||||||
acomp.setAtividadesNaoEstudadas(naoestudadas);
|
if (acomp.setAtividadesNaoEstudadas(naoestudadas))
|
||||||
|
return Erro.E4;
|
||||||
|
|
||||||
|
if (ia + explicadas + semajuda + naoestudadas > entregues)
|
||||||
|
return Erro.E4;
|
||||||
|
|
||||||
this.dados.appendAcompanhamento(acomp);
|
this.dados.appendAcompanhamento(acomp);
|
||||||
|
return "Acompanhamento registrado com sucesso.";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void listarAlunos() {
|
public String listarAlunos() {
|
||||||
this.dados.listAlunos();
|
return this.dados.listAlunos();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void listarBolsistas() {
|
public String listarBolsistas() {
|
||||||
this.dados.listBolsistas();
|
return this.dados.listBolsistas();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void maiorNome(){
|
public String maiorNome(){
|
||||||
this.dados.maiorNome();
|
return this.dados.maiorNome();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void vogaisNomes(){
|
public String vogaisNomes(){
|
||||||
System.out.println("Numero total de vogais: " + this.dados.totalVowels());
|
return this.dados.totalVowels();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void percentualAlunos() {
|
public String percentualAlunos() {
|
||||||
|
String curso = "";
|
||||||
|
|
||||||
|
while (curso.length() == 0){
|
||||||
System.out.println("Insira um curso:");
|
System.out.println("Insira um curso:");
|
||||||
String curso = input.nextLine();
|
curso = input.nextLine();
|
||||||
|
}
|
||||||
|
|
||||||
System.out.print("O percentual de alunos matriculados nesse curso é de: " + this.dados.coursePercent(curso) + "%\n");
|
return "O percentual de alunos matriculados nesse curso é de: " + this.dados.coursePercent(curso) + "%";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void mediaIdadeAlunos() {
|
public String mediaIdadeAlunos() {
|
||||||
System.out.println("Idade média dos alunos: " + this.dados.averageAge());
|
return this.dados.averageAge();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void criarChamada() {
|
public String criarChamada() {
|
||||||
this.dados.makeChamada();
|
this.dados.makeChamada();
|
||||||
|
|
||||||
|
if (chamada().equals(Erro.E5))
|
||||||
|
return chamada();
|
||||||
|
|
||||||
|
return "Chamada criada com sucesso.";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void chamada() {
|
public String chamada() {
|
||||||
this.dados.printChamada();
|
return this.dados.printChamada();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void 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.E2;
|
||||||
|
|
||||||
System.out.println("O risco pedagógico deste aluno é " + acomp.getRiscoLabel());
|
return acomp.getRiscoLabel();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void relatorioRisco() {
|
public String relatorioRisco() {
|
||||||
|
|
||||||
this.dados.riskReport();
|
return this.dados.riskReport();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void altoRisco() {
|
public String altoRisco() {
|
||||||
this.dados.riskReportHigh();
|
return this.dados.riskReportHigh();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void inovacao() {
|
public String inovacao() {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
68
Menu.java
68
Menu.java
|
|
@ -12,9 +12,10 @@ public class Menu {
|
||||||
gerenciador = new Gerenciador(dados);
|
gerenciador = new Gerenciador(dados);
|
||||||
|
|
||||||
Scanner input = new Scanner(System.in);
|
Scanner input = new Scanner(System.in);
|
||||||
|
String result = "";
|
||||||
while (true) {
|
while (true) {
|
||||||
System.out.println(
|
System.out.println(
|
||||||
"Escolha uma opcao:" + "\n" +
|
"\fEscolha uma opcao:" + "\n" +
|
||||||
"1 - Cadastro de Aluno" + "\n" +
|
"1 - Cadastro de Aluno" + "\n" +
|
||||||
"2 - Cadastro de Bolsisa " + "\n" +
|
"2 - Cadastro de Bolsisa " + "\n" +
|
||||||
"3 - Regisrar dados de acompanhamento" + "\n" +
|
"3 - Regisrar dados de acompanhamento" + "\n" +
|
||||||
|
|
@ -30,70 +31,49 @@ public class Menu {
|
||||||
"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 - (Colocar inovacao aqui)" + "\n" +
|
||||||
"16 - Encerrar o programa");
|
"16 - Encerrar o programa\n\n" +
|
||||||
prompt(input.nextInt());
|
result);
|
||||||
|
|
||||||
|
result = prompt(input.nextInt());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void prompt(int option) {
|
public static String prompt(int option) {
|
||||||
switch (option) {
|
switch (option) {
|
||||||
|
|
||||||
// passar parametros
|
|
||||||
|
|
||||||
// String nome,int idade,String local, String curso, String matricula,int
|
|
||||||
// semestre,int ano ,bool bolsista, String projeto, String orientador
|
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
gerenciador.cadastrarAluno(); // completar com o nome correto das gerenciadores
|
return gerenciador.cadastrarAluno();
|
||||||
break;
|
|
||||||
case 2:
|
case 2:
|
||||||
gerenciador.cadastrarBolsista(false, null);
|
return gerenciador.cadastrarBolsista(false, null);
|
||||||
break;
|
|
||||||
case 3:
|
case 3:
|
||||||
gerenciador.registrarAcompanhamento();
|
return gerenciador.registrarAcompanhamento();
|
||||||
break;
|
|
||||||
case 4:
|
case 4:
|
||||||
gerenciador.listarAlunos();
|
return gerenciador.listarAlunos();
|
||||||
break;
|
|
||||||
case 5:
|
case 5:
|
||||||
gerenciador.listarBolsistas();
|
return gerenciador.listarBolsistas();
|
||||||
break;
|
|
||||||
case 6:
|
case 6:
|
||||||
gerenciador.maiorNome();
|
return gerenciador.maiorNome();
|
||||||
break;
|
|
||||||
case 7:
|
case 7:
|
||||||
gerenciador.vogaisNomes();
|
return gerenciador.vogaisNomes();
|
||||||
break;
|
|
||||||
case 8:
|
case 8:
|
||||||
gerenciador.percentualAlunos();
|
return gerenciador.percentualAlunos();
|
||||||
break;
|
|
||||||
case 9:
|
case 9:
|
||||||
gerenciador.mediaIdadeAlunos();
|
return gerenciador.mediaIdadeAlunos();
|
||||||
break;
|
|
||||||
case 10:
|
case 10:
|
||||||
gerenciador.criarChamada();
|
return gerenciador.criarChamada();
|
||||||
break;
|
|
||||||
case 11:
|
case 11:
|
||||||
gerenciador.chamada();
|
return gerenciador.chamada();
|
||||||
break;
|
|
||||||
case 12:
|
case 12:
|
||||||
gerenciador.calcularRisco();
|
return gerenciador.calcularRisco();
|
||||||
break;
|
|
||||||
case 13:
|
case 13:
|
||||||
gerenciador.relatorioRisco();
|
return gerenciador.relatorioRisco();
|
||||||
break;
|
|
||||||
case 14:
|
case 14:
|
||||||
gerenciador.altoRisco();
|
return gerenciador.altoRisco();
|
||||||
break;
|
|
||||||
// TODO: IMPLEMENTAR INOVAÇÃO
|
// TODO: IMPLEMENTAR INOVAÇÃO
|
||||||
case 15:
|
case 15:
|
||||||
gerenciador.inovacao();
|
return gerenciador.inovacao();
|
||||||
break;
|
|
||||||
case 16:
|
case 16:
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
|
}
|
||||||
default:
|
return Erro.E1;
|
||||||
System.out.println("Opção inválida");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue