Skip to content

Commit

Permalink
total com 20 anos
Browse files Browse the repository at this point in the history
  • Loading branch information
365g3s07 committed Nov 2, 2020
1 parent 578ecc1 commit d5062a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modulo_5/desafio_modulo5.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ void main() {
print('Pacientes com mais de 20 anos');
print('-----------------------------');

int i = 0;
for (var paciente in pacientes) {
List dadosPaciente = paciente.split('|');

int idade = int.parse(dadosPaciente[1]);

if (idade >= 20) {
i++;
print(dadosPaciente[0]);
}
}

print("\n");
print("Total de Pacientes com mais de 20 anos: $i");
print("\n");
print('Pacientes por família');
print('-----------------------------');
Expand Down

0 comments on commit d5062a3

Please sign in to comment.