Share Pastebin
Guest
Public paste!

Rodrigo F

By: a guest | Jun 30th, 2009 | Syntax: None | Size: 1.17 KB | Hits: 69 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. Procedimento Varrer;
  2. var
  3.   i: inteiro
  4.   NomesAlunos: String;
  5. inicio
  6.   NomesAlunos := '' // inicialização da variável
  7.   Para i:= 0 a 30 faça inicio
  8.     Se Notas[i] >= 4 e Notas[i] <= 5.9 entao
  9.       Se NomesAlunos = '' então
  10.          NomesAlunos := Nomes[i]
  11.       Senão
  12.          NomesAlunos := NomesAlunos + ', ' +  +  Nomes[i] // recebe ele mesmo e incrementa o nome no array  
  13.   fim;  
  14. fim;
  15.  
  16.  
  17. Lembrando que o preenchimento dos vetores já existem (ou seja já estão feitos)
  18.  
  19. Passo 7
  20.  
  21. procedimento Perc;
  22. var
  23.   ComVS, SemVS, i: Integer;
  24.   PercComVS, PercSemVS : Numeric;
  25. inicio
  26.   ComVS := 0;
  27.   SemVS := 0;
  28.   PercComVS := 0;
  29.   PercSemVS := 0;
  30.  
  31.   Para i:= 1 a 30 faça inicio
  32.     Se Notas[i] >= 6.0 entao  // testa quem passou direto
  33.       SemVS := SemVS + 1
  34.     Senão Se Notas[i] >= 4.0 e Notas[i] <= 5.9  entao
  35.       ComVS := ComVS + 1;
  36.   fim
  37.  
  38.   // Depois das varíveis calculadas, ele pegará o percentual (lembrando que são 30 alunos, nesse meu exemplo)
  39.   PercComVS := (ComVS / 30) * 100;
  40.   PercSemVS := (SemVS / 30) * 100;
  41.  
  42.   Mostra('Percentual Com Verificação: '+ PercComVS +'%');
  43.   Mostra('Percentual Sem Verificação: '+ PercSemVS +'%');
  44. fim;
  45.  
  46. fim