0
I have doubts about this:
Write an algorithm that asks for the age of several people (USE REPEAT). Please report 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 used in counting).
I got this far but I stopped because I don’t know how to use it very well repeat.
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 help me?
This is Portugol?
– Sam
Please insert the programming language.
– David Schrammel