I am in doubt on this issue:
Write an algorithm that requests the age of several people (USE REPEAT). Enter the total number of people under 25 and the total number of people over 50. The program ends when age is negative (Not to be counted).
I came here but I packed because I do not know how to use the repeat very well.
Algoritmo "semnome"
var
idade, cont, f1, f2: inteiro
outro: caracter
inicio
cont <- 0
f1 <- 0
f2 <- 0
repita
escreva("Informe a idade: ")
leia(idade)
cont <- cont + 1
se (idade <= 25) entao
f1 <- f1 + 1
senao
se ((idade >= 26) e (idade <= 51)) entao
f2 <- f2 + 1
fimse
fimse
escreval("Outra pessoa [S/N]: ")
leia(outro)
ate (outro = "N")
escreval("Total de pessoas informadas: ", cont)
escreval("Faixa 1: ", f1)
escreval("Faixa 2: ", f2)
Could you help me?