I would like to know how to assign characters already typed by the user in the loop.
Code:
nu,cont,contp :inteiro
pot :inteiro
tipo :caractere
inicio
cont <- 1
escreval("digite a qtd de usinas")
leia (nu)
escreval ("H-hidroeletrica")
escreval("T-Termoeletrica")
escreval("E-EOLICA")
repita
escreval("digite o TIPO de cada usina ")
leia(tipo)
cont <- cont+1
ate (cont > nu)
repita
contp <- contp+1
escreval("Digite a **POTENCIA** de cada usina ")
leia(pot)
ate contp = nu)
My question and I asked the user to tell you the type of the H-E-O plant. Just below ask to say the power would like to know how to assign the types to the values entered?
For a better understanding where I want to get the exercise is this:
After reading this number of mills, the program asks for each plant which type of plant (H-hydroelectric, T-thermoelectric, E-eolic) and which power is generated, after reading the data from all the plants in the program counts the total energy generated for each type and evaluates in which flag the region should operate. when more than 20% of the energy generated is from a thermoelectric plant, it operates on a red flag. When the thermoelectric generation is between 10 and 20% does the region operate on a yellow flag?