Algorithm of Portugol SE

Asked

Viewed 49 times

0

I have a small question about portugol. The question asks these details:

Above R $ 400,00
30% of the average balance R$ 400,00 (inclusive) up to R$ 300,00
25 % of the average balance R$ 300,00 (inclusive) up to R$ 200,00
20% of the average balance Up to R $ 200,00
10% of the average balance.

My code went like this:

funcao inicio()
{
    real saldo,credito
    escreva("Digite seu saldo médio: ")
    leia(saldo)
    se(saldo>400){credito=0.30 escreva("Seu saldo é de: R$",saldo,"\nSeu bonus é de: R$",(saldo*credito),"\nValor total: R$",(saldo*credito+saldo))}
    se(saldo=400 e saldo=>300){credito=0.25 escreva("Seu saldo é de: R$",saldo,"\nSeu bonus é de: R$",(saldo*credito),"\nValor total: R$",(saldo*credito+saldo))}
    se(saldo=300 e saldo=>200){credito=0.20 escreva("Seu saldo é de: R$",saldo,"\nSeu bonus é de: R$",(saldo*credito),"\nValor total: R$",(saldo*credito+saldo))}
    se(saldo=200){credito=0.10 escreva("Seu saldo é de: R$",saldo,"\nSeu bonus é de: R$",(saldo*credito),"\nValor total: R$",(saldo*credito+saldo))}
}

Whenever I try to run the program it says that the expression has not been started correctly, any suggestions about? Thanks for your attention since.

  • Change: se(saldo=400 e saldo=>300){ for se(saldo<=400 e saldo=>300){. Idem se where he wrote only =. The use of the clause senão at the controls se could facilitate your testing.

  • I tried your tip but I’m still the same, the program says the error is on the line se(saldo<=400 e saldo=>300){ I will try to talk to my teacher to seek out how I was supposed to do. Thank you from my heart for your help.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.