I have this exercise to do:
Make a program that asks the user for the number of energy in a region, after reading this amount of power plants, the asks for each plant which type of plant (h-hydroelectric T- E-thermoelectric and what the generated power, after reading the data of all plants, the program counts the total energy generated for each type and evaluates on which flag the region should operate. When more than 20% of generation generated is from thermoelectric it is operated on red flag. when the thermoelectric generation is between 10 and 20% the region operates in yellow flag.
But I'm having a hard time. I did this part of the code, but I can not get the repetition to work in a way that repeats itself to the number of mills entered by the user:
algoritmo "semnome"
// Função :
// Autor :
// Data : 08/05/2015
// Seção de Declarações
var nu,cont :inteiro tipo :caractere
inicio
cont <- 1
escreval("digite a qtd de usinas")
leia (nu)
repita
escreval("digite o tipo de cada usina ")
leia(tipo)
ate (cont = nu)
// Seção de Comandos
fimalgoritmo