- Procedimento Varrer;
- var
- i: inteiro
- NomesAlunos: String;
- inicio
- NomesAlunos := '' // inicialização da variável
- Para i:= 0 a 30 faça inicio
- Se Notas[i] >= 4 e Notas[i] <= 5.9 entao
- Se NomesAlunos = '' então
- NomesAlunos := Nomes[i]
- Senão
- NomesAlunos := NomesAlunos + ', ' + + Nomes[i] // recebe ele mesmo e incrementa o nome no array
- fim;
- fim;
- Lembrando que o preenchimento dos vetores já existem (ou seja já estão feitos)
- Passo 7
- procedimento Perc;
- var
- ComVS, SemVS, i: Integer;
- PercComVS, PercSemVS : Numeric;
- inicio
- ComVS := 0;
- SemVS := 0;
- PercComVS := 0;
- PercSemVS := 0;
- Para i:= 1 a 30 faça inicio
- Se Notas[i] >= 6.0 entao // testa quem passou direto
- SemVS := SemVS + 1
- Senão Se Notas[i] >= 4.0 e Notas[i] <= 5.9 entao
- ComVS := ComVS + 1;
- fim
- // Depois das varíveis calculadas, ele pegará o percentual (lembrando que são 30 alunos, nesse meu exemplo)
- PercComVS := (ComVS / 30) * 100;
- PercSemVS := (SemVS / 30) * 100;
- Mostra('Percentual Com Verificação: '+ PercComVS +'%');
- Mostra('Percentual Sem Verificação: '+ PercSemVS +'%');
- fim;
- fim
