-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLabScholMain.java
More file actions
853 lines (638 loc) · 29.3 KB
/
LabScholMain.java
File metadata and controls
853 lines (638 loc) · 29.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
package aplication;
// Listar todas as pessoas cadastradas.
// O usuário deverá informar quais categorias de pessoas deseja listar (deve-se listar Código, Nome e CPF):
//Alunos
//Professores
//Funcionários
//Todos
//Relatório dos Alunos.
// O usuário deve escolher qual categoria apresentar
// (deve-se listar código, nota e total de atendimentos pedagógicos):
//Ativo
//Irregular
//Atendimento pedagógico
//Inativo
//Todos
//Relatório dos professores. O usuário deve escolher qual categoria apresentar:
//Front-End
//Back-End
//Full-Stack
//Todos
//Alunos com mais atendimentos pedagógicos
//Pedagogos com mais atendimentos pedagógicos
import entities.Aluno;
import entities.DigitarNumeroException;
import entities.Pedagogo;
import entities.Professor;
import java.time.DateTimeException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.List;
import java.util.Scanner;
public class LabScholMain {
static Scanner scanner = new Scanner(System.in);
static Scanner scanner2 = new Scanner(System.in);
static List<Aluno> alunos = new ArrayList<>();
static List<Professor> professores = new ArrayList<>();
static List<Pedagogo> pedagogos = new ArrayList<>();
static String telefone = "";
static String cpf = "";
static String matricula;
static String formacaoAcademica;
static String desenvolvimento;
static String estado;
static String data;
static Integer idPedagogo;
static Integer contadorAluno;
public static void main(String[] args) {
// lista para testes
Integer id;
String data2="28/12/1966";
Aluno teste1 = new Aluno("Fernando Teste1","48-1-9999-9999",parseLocalDate(data2),"012-345-678/91", id=10,"Ativo",10.0,"sim",18,0);
Aluno teste2 = new Aluno("Fernando Teste2","48-2-9999-9999",parseLocalDate(data2),"013-345-678/92", id=11,"Irregular",9.0,"não",0,0);
Aluno teste3 = new Aluno("Fernando Teste3","48-3-9999-9999",parseLocalDate(data2),"014-345-678/92", id=12,"Em atendimento Pedagógico.",8.0,"sim",20,0);
Aluno teste4 = new Aluno("Fernando Teste4","48-4-9999-9999",parseLocalDate(data2),"015-345-678/92", id=13,"Inativo",7.0,"não",0,0);
alunos.add(teste1);
alunos.add(teste2);
alunos.add(teste3);
alunos.add(teste4);
Professor professor1 = new Professor("Fernando Prof Teste1", "48-1-2222-2222", parseLocalDate(data2), "111-222-333-44", id=14, "Graduação incompleta","Front-End", "sim" );
Professor professor2 = new Professor("Fernando Prof Teste2", "48-2-2222-2222", parseLocalDate(data2), "222-222-333-44", id=15, "Graduação completa","Back-End", "não" );
Professor professor3 = new Professor("Fernando Prof Teste3", "48-3-2222-2222", parseLocalDate(data2), "333-222-333-44", id=16, "Mestrado","Full-Stack", "sim" );
Professor professor4 = new Professor("Fernando Prof Teste4", "48-4-2222-2222", parseLocalDate(data2), "444-222-333-44", id=17, "Doutorado","Front-End", "não" );
professores.add(professor1);
professores.add(professor2);
professores.add(professor3);
professores.add(professor4);
Pedagogo pedagogo1 = new Pedagogo ("Fer Pedag Teste1", "48-5-5555-5555", parseLocalDate(data2), "555-666-777-88", id=18, 0, 0);
Pedagogo pedagogo2 = new Pedagogo ("Fer Pedag Teste2", "48-6-5555-5555", parseLocalDate(data2), "666-666-777-88", id=19, 1,0);
Pedagogo pedagogo3 = new Pedagogo ("Fer Pedag Teste3", "48-7-5555-5555", parseLocalDate(data2), "777-666-777-88", id=20, 0,0);
Pedagogo pedagogo4 = new Pedagogo ("Fer Pedag Teste4", "48-8-5555-5555", parseLocalDate(data2), "888-666-777-88", id=21, 1,0);
pedagogos.add( pedagogo1);
pedagogos.add( pedagogo2);
pedagogos.add( pedagogo3);
pedagogos.add( pedagogo4);
// final lista teste.
menuBoasVindas();
}
private static void menuBoasVindas() {
try {
System.out.println("<<<<<<<<<<<< Lab School >>>>>>>>>>>>");
System.out.println("Bem-vindo, escolha a opção desejada:" +
"\n------------------------------------" +
"\n1 - Fazer Cadastro" +
"\n2 - Visualizar Cadastros" +
"\n3 - Relatórios Alunos" +
"\n4 - Relatórios Professores" +
"\n5 - Relatórios Pedagógicos" +
"\n6 - Alterar condição de matrícula" +
"\n7 - Marcar atendimento pedagógico" +
"\n8 - Encerrar a sessão");
int boasVindas = scanner.nextInt();
switch (boasVindas) {
case 1:
fazerCadastros();
break;
case 2:
listarCadastros();
break;
case 3:
relatorioAlunos();
break;
case 4:
relatorioProfessores();
break;
case 5:
relatorioPedagogico();
break;
case 6:
System.out.println("Digite o id do aluno: ");
int idaluno = scanner.nextInt();
for(int i = 0; i < alunos.size(); i++) {
if(alunos.get(i).getId().equals(idaluno)){
System.out.println(alunos.get(i));
System.out.println("Condição atual: " + alunos.get(i).getMatricula());
System.out.println("");
}
}
condicaoAluno();
for(int i = 0; i < alunos.size(); i++) {
if (alunos.get(i).getId().equals(idaluno)) {
alunos.get(i).setMatricula(matricula);
System.out.println("Condição alterada com sucesso.");
System.out.println("");
}
}
menuBoasVindas();
case 7:
marcarAtendimentoPedagogico();
menuBoasVindas();
case 8:
System.out.println("Agradecemos sua presença.");
System.exit(0);
break;
default:
System.out.println("Opção inválida!");
}
}catch (InputMismatchException e){
System.out.println("Você tem que digitar um número");
}finally {
System.out.println("Programa encerrado!");
}
}
private static void marcarAtendimentoPedagogico() {
System.out.println("<<<<* Atendimento Pedagogico *>>>>");
System.out.println("Para agendar um atendimento,");
System.out.println("digite o Id do Aluno: ");
int idAluno = scanner.nextInt();
System.out.println("Digite o Id do Pedagogo: ");
int idPedagogo = scanner.nextInt();
for (int i = 0; i < alunos.size(); i++) {
if ((alunos.get(i).getId().equals(idAluno))) {
Integer auxiliar = ((alunos.get(i).getContadorAluno()+1));
alunos.get(i).setContadorAluno(auxiliar);
System.out.println("cont aluno: " + alunos.get(i).getContadorAluno());
}
}
for (int i = 0; i < pedagogos.size(); i++) {
if ((pedagogos.get(i).getId().equals(idPedagogo))) {
Integer auxiliar = ((pedagogos.get(i).getContadorPedagogo()+1));
pedagogos.get(i).setContadorPedagogo(auxiliar);
System.out.println("cont pedagogo: " + pedagogos.get(i).getContadorPedagogo());
}
}
System.out.println("Agendamento efetuado com sucesso!");
menuBoasVindas();
}
private static void relatorioPedagogico() {
System.out.println("Escolha uma opção:" +
"\n1 - Alunos com mais atendimentos pedagógicos" +
"\n2 - Pedagogos com mais atendimentos pedagógicos");
int relatPedagogico = scanner.nextInt();
switch (relatPedagogico){
case 1:
for(int i = 0; i < alunos.size(); i++) {
if ((alunos.get(i).getMatricula().equals("Em atendimento Pedagógico."))
||((alunos.get(i).getAtendimento().equals("sim")))) {
System.out.println("Aluno: "+ alunos.get(i).getNome());
int idped = (alunos.get(i).getIdPedagogo());
pedagogos.get(i).getId().equals(idped);
System.out.println("Nome do Pedagogo: " + pedagogos.get(i).getNome());
System.out.println("Contador: " + alunos.get(i).getContadorAluno());
System.out.println("");
}
}
menuBoasVindas();
break;
case 2:
for(int i = 0; i < alunos.size(); i++) {
if ((alunos.get(i).getMatricula().equals("Em atendimento Pedagógico."))
||((alunos.get(i).getAtendimento().equals("sim")))) {
int idped = (alunos.get(i).getIdPedagogo());
pedagogos.get(i).getId().equals(idped);
System.out.println("Nome do Pedagogo: " + pedagogos.get(i).getNome());
System.out.println("Nome do(s) Aluno(s): " + alunos.get(i).getNome());
System.out.println("Contador: " + pedagogos.get(i).getContadorPedagogo());
System.out.println("");
}
}
menuBoasVindas();
break;
default:
System.out.println("Opção inválida");
}
}
private static void relatorioProfessores() {
try {
System.out.println("Escolha o relatório a ser listado:" +
"\n-----------------------------------------" +
"\n1 - Front-End" +
"\n2 - Back-End" +
"\n3 - Full-Stack" +
"\n4 - Todos");
int relatorioProfessor = scanner.nextInt();
switch (relatorioProfessor) {
case 1:
for(int i = 0; i < professores.size(); i++) {
if (professores.get(i).getDesenvolvimento().equals("Front-End")) {
System.out.println(professores.get(i));
}
}
System.out.println(" ");
menuBoasVindas();
break;
case 2:
for(int i = 0; i < professores.size(); i++) {
if (professores.get(i).getDesenvolvimento().equals("Back-End")) {
System.out.println(professores.get(i));
}
}
System.out.println(" ");
menuBoasVindas();
break;
case 3:
for(int i = 0; i < professores.size(); i++) {
if (professores.get(i).getDesenvolvimento().equals("Full-Stack")) {
System.out.println(professores.get(i));
}
}
System.out.println(" ");
menuBoasVindas();
break;
case 4:
// se condição matricula for igual a Inativo imprime professores
System.out.println("Professores:");
professores.forEach(System.out::print);
System.out.println("");
System.out.println("");
menuBoasVindas();
break;
default:
System.out.println("Opção inválida!");
}
}catch (InputMismatchException e){
System.out.println("Você tem que digitar um número");
}
}
private static void relatorioAlunos() {
try {
System.out.println("Escolha o relatório a ser listado:" +
"\n-----------------------------------------" +
"\n1 - Alunos Ativos" +
"\n2 - Alunos Irregulares" +
"\n3 - Alunos em Atendimento pedagógico" +
"\n4 - Alunos Inativos");
int relatAlunos = scanner.nextInt();
switch (relatAlunos) {
case 1:
//
for(int i = 0; i < alunos.size(); i++) {
if (alunos.get(i).getMatricula().equals("Ativo")) {
System.out.println(alunos.get(i));
System.out.println("Nota: " + alunos.get(i).getNota());
System.out.println("Atendimento: " + alunos.get(i).getAtendimento());
}
}
System.out.println(" ");
menuBoasVindas();
break;
case 2:
// se condição matricula for igual a Irregulares imprime alunos
for(int i = 0; i < alunos.size(); i++) {
if (alunos.get(i).getMatricula().equals("Irregular")) {
System.out.println(alunos.get(i));
System.out.println("Nota: " + alunos.get(i).getNota());
System.out.println("Atendimento: " + alunos.get(i).getAtendimento());
}
}
System.out.println(" ");
menuBoasVindas();
break;
case 3:
// se condição matricula for igual a Atendimento pedag imprime alunos
for(int i = 0; i < alunos.size(); i++) {
if ((alunos.get(i).getMatricula().equals("Em atendimento Pedagógico."))
||((alunos.get(i).getAtendimento().equals("sim")))) {
System.out.println(alunos.get(i));
System.out.println("Nota: " + alunos.get(i).getNota());
System.out.println("Atendimento: " + alunos.get(i).getAtendimento());
}
}
System.out.println(" ");
menuBoasVindas();
break;
case 4:
// se condição matricula for igual a Inativo imprime alunos
for(int i = 0; i < alunos.size(); i++) {
if (alunos.get(i).getMatricula().equals("Inativo")) {
System.out.println(alunos.get(i));
System.out.println("Nota: " + alunos.get(i).getNota());
System.out.println("Atendimento: " + alunos.get(i).getAtendimento());
}
}
System.out.println(" ");
menuBoasVindas();
break;
default:
System.out.println("Opção inválida!");
}
}catch (InputMismatchException e){
System.out.println("Você tem que digitar um número");
}
}
private static void listarCadastros() {
System.out.println("<<<<<<* Lista Cadastros *>>>>>>");
System.out.println(" Digite um número para ver " +
"\n as pessoas cadastradas:" +
"\n1 - Alunos" +
"\n2 - Professores" +
"\n3 - Funcionários" +
"\n4 - Todos");
Integer listarCadastro = scanner.nextInt();
switch (listarCadastro){
case 1:
System.out.println("Alunos:");
alunos.forEach(System.out::print);
System.out.println("");
System.out.println("");
menuBoasVindas();
break;
case 2:
System.out.println("Professores:");
professores.forEach(System.out::print);
System.out.println("");
System.out.println("");
menuBoasVindas();
break;
case 3:
System.out.println("Professores:");
professores.forEach(System.out::print);
System.out.println("");
System.out.println("");
System.out.println("Pedagogos:");
pedagogos.forEach(System.out::print);
System.out.println("");
System.out.println("");
menuBoasVindas();
break;
case 4:
System.out.println("Alunos:");
alunos.forEach(System.out::print);
System.out.println("");
System.out.println("");
System.out.println("Professores:");
professores.forEach(System.out::print);
System.out.println("");
System.out.println("");
System.out.println("Pedagogos:");
pedagogos.forEach(System.out::print);
System.out.println("");
System.out.println("");
menuBoasVindas();
break;
default:
System.out.println("Opção inválida!");
}
}
private static void fazerCadastros() {
try {
System.out.println("<<<<<<<<<<<< Cadastros >>>>>>>>>>>>");
System.out.println(" Bem-vindo ao setor de cadastro," +
"\n por favor escolha uma opção:" +
"\n----------------------------------" +
"\n1 - Cadastrar Aluno" +
"\n2 - Cadastrar Professor" +
"\n3 - Cadastrar Pedagogo");
int cadastro = scanner.nextInt();
switch (cadastro) {
case 1:
condicaoAluno();
cadastroAluno();
break;
case 2:
cadastroProfessor();
break;
case 3:
cadastroPedagogo();
break;
default:
System.out.println("Opção Inválida!");
}
}catch (InputMismatchException e){
System.out.println("Você tem que digitar um número!");
}
}
private static void condicaoAluno() {
try {
System.out.println("Escolha a condição de matrícula do aluno:" +
"\n-----------------------------------------" +
"\n1 - Ativo" +
"\n2 - Irregular" +
"\n3 - Atendimento pedagógico" +
"\n4 - Inativo");
int condicaoMatricula = scanner.nextInt();
switch (condicaoMatricula) {
case 1:
matricula = "Ativo";
System.out.println("O aluno encontra-se " + matricula + ".");
break;
case 2:
matricula = "Irregular";
System.out.println("O aluno encontra-se " + matricula + ".");
break;
case 3:
matricula = "Em atendimento Pedagógico.";
System.out.println("O aluno encontra-se " + matricula + ".");
atendimentoPedagogico();
break;
case 4:
matricula = "Inativo";
System.out.println("O aluno encontra-se " + matricula + ".");
break;
default:
System.out.println("Opção inválida!");
}
}catch (InputMismatchException e){
System.out.println("Você tem que digitar um número");
}
}
private static void atendimentoPedagogico() {
System.out.println("Digite o nome do Pedagogo:");
System.out.println("--------------------------");
String pedagogo = scanner2.nextLine();
System.out.println("Digite o nome do Aluno");
System.out.println("----------------------");
String alunopedagogo = scanner2.nextLine();
}
private static void cadastroPedagogo() {
try {
Integer id = pedagogos.size() + 1;
System.out.println("id= " + id);
System.out.println("------* Cadastro do Pedagogo *------");
System.out.println("Nome completo: ");
String nome = scanner2.nextLine();
do {
System.out.println("Telefone XX-X-XXXX-XXXX: ");
telefone = scanner.next();
if (telefone.length() < 14) {
System.out.println("Digite corretamente o número do telefone.");
} else {
}
} while (!(telefone.length() == 14));
System.out.println("Data de Nascimento dia/mês/ano");
String data = scanner.next();
do {
System.out.println("CPF XXX-XXX-XXX/XX: ");
cpf = scanner.next();
if (cpf.length() < 14) {
System.out.println("Digite corretamente o número do CPF.");
} else {
}
} while (!(cpf.length() == 14));
System.out.println("Atendimento (1 ou 2): ");
Integer atendimento = scanner.nextInt();
if(atendimento==1){
System.out.println("sim");
}else {
System.out.println("não");
}
Pedagogo pedagogoInstanciados = new Pedagogo (nome, telefone, parseLocalDate(data), cpf, id, atendimento,0);
pedagogos.add( pedagogoInstanciados);
//String nome, String telefone, LocalDate dataNascimento, String cpf, Integer id, Integer atendimento
}catch (InputMismatchException e){
System.out.println("Você não pode inserir um número");
//menuBoasVindas();
}catch (DateTimeException e){
System.out.println("Você informou a data de nascimento errada." +
"\nEscolha a opção novamente.");
}
menuBoasVindas();
}
private static void cadastroProfessor() {
try {
Integer id = professores.size() + 1;
System.out.println("id= " + id);
System.out.println("------* Cadastro do Professor *------");
System.out.println("Nome completo: ");
String nome = scanner2.nextLine();
do {
System.out.println("Telefone XX-X-XXXX-XXXX: ");
telefone = scanner.next();
if (telefone.length() < 14) {
System.out.println("Digite corretamente o número do telefone.");
} else {
}
} while (!(telefone.length() == 14));
System.out.println("Data de Nascimento dia/mês/ano");
String data = scanner.next();
do {
System.out.println("CPF XXX-XXX-XXX/XX: ");
cpf = scanner.next();
if (cpf.length() < 14) {
System.out.println("Digite corretamente o número do CPF.");
} else {
}
} while (!(cpf.length() == 14));
System.out.println("Formação acadêmica (escolha uma opção): " +
"\n1 - Graduação incompleta" +
"\n2 - Graduação completa" +
"\n3 - Mestrado" +
"\n4 - Doutorado");
int graduacao = scanner.nextInt();
switch (graduacao){
case 1:
formacaoAcademica = "Graduação incompleta";
break;
case 2:
formacaoAcademica = "Graduação completa";
break;
case 3:
formacaoAcademica = "Mestrado";
break;
case 4:
formacaoAcademica = "Doutorado";
break;
default:
System.out.println("Opção Inválida!");
}
System.out.println("Experiência em desenvolvimento (escolha uma opção): " +
"\n1 - Front-End" +
"\n2 - Back-End" +
"\n3 - Full-Stack")
;
int desenvolv = scanner.nextInt();
switch (desenvolv){
case 1:
desenvolvimento = "Front-End";
break;
case 2:
desenvolvimento = "Back-End";
break;
case 3:
desenvolvimento = "Full-Stack";
break;
default:
System.out.println("Opção Inválida!");
}
System.out.println("Ativo? (sim ou não): ");
String atividade = scanner.next();
estado = atividade;
Professor professoresInstanciados = new Professor(nome, telefone, parseLocalDate(data), cpf, id,
formacaoAcademica, desenvolvimento, estado );
professores.add(professoresInstanciados);
//(String nome, String telefone, LocalDate dataNascimento, String cpf, Integer id,
// String formacaoAcademica, String desenvolvimento, Boolean estado) {
}catch (InputMismatchException e){
System.out.println("Você não pode inserir um número");
//menuBoasVindas();
}catch (DateTimeException e){
System.out.println("Você informou a data de nascimento errada." +
"\nEscolha a opção novamente.");
}
menuBoasVindas();
}
private static void cadastroAluno() {
try {
Integer id = alunos.size() + 1;
System.out.println("id= " + id);
System.out.println("------* Cadastro do Aluno *------");
System.out.println("Nome completo: ");
String nome = scanner2.nextLine();
do {
System.out.println("Telefone XX-X-XXXX-XXXX: ");
telefone = scanner.next();
if (telefone.length() < 14) {
System.out.println("Digite corretamente o número do telefone.");
} else {
}
} while (!(telefone.length() == 14));
System.out.println("Data de Nascimento dia/mês/ano");
String data = scanner.next();
do {
System.out.println("CPF XXX-XXX-XXX/XX: ");
cpf = scanner.next();
if (cpf.length() < 14) {
System.out.println("Digite corretamente o número do CPF.");
} else {
}
} while (!(cpf.length() == 14));
System.out.println("Nota (0 - 10): ");
Double nota = scanner.nextDouble();
System.out.println("Atendimento Pedagógico (sim ou não): ");
String atendimento = scanner.next();
if (atendimento.equals("sim")) {
pedagogos.forEach(System.out::print);
System.out.println("");
System.out.println("Digite o id do Pedagogo: ");
idPedagogo = scanner.nextInt();
Integer contadorAluno = +1;
} else {
idPedagogo = 0;
}
Aluno alunosInstanciados = new Aluno(nome, telefone, parseLocalDate(data), cpf, id, matricula, nota, atendimento, idPedagogo, contadorAluno);
alunos.add(alunosInstanciados);
throw new DigitarNumeroException();
}catch (DigitarNumeroException e){
System.out.println(e.getMessage());
}catch (InputMismatchException e){
System.out.println("Você não pode inserir um número");
//menuBoasVindas();
}catch (DateTimeException e){
System.out.println("Você informou a data de nascimento errada." +
"\nEscolha a opção novamente.");
//menuBoasVindas();
}
menuBoasVindas();
//String nome, String telefone, LocalDate dataNascimento, String cpf, Integer id,
// String matricula, Double nota, Integer atendimento
}
private static LocalDate parseLocalDate(String data) {
String[] arrayData = data.split("/");
int[] arrayDataInt = new int[3];
for (int i = 0; i < arrayData.length; i++) {
arrayDataInt[i] = Integer.parseInt(arrayData[i]);
}
return LocalDate.of(arrayDataInt[2], arrayDataInt[1], arrayDataInt[0]);
}
}