0
I need to work out an algorithm for "Purchase Order". Where the user is willing to write the name of the product and its value and quantity, and at the end the code shows the multiplication result (unit price*quantity). However, my code is wrong and I’m in doubt how to solve it. (I’m a beginner in the field of programming)
The code I created, where the bug is?
Var
produto,totalPedido,precoUnit:real
quant:inteiro
i:inteiro
Inicio
// Seção de Comandos, procedimento, funções, operadores, etc...
enquanto (i <> N) faca
escreva("Produto: ")
leia(produto)
escreva("Preço unitário: ")
leia(precoUnit)
escreva("Quantidade: ")
leia(quant)
fimenquanto
totalPedido <- precoUnit * quant
escreva("Total de pedidos: R$",totalPedido)
Fimalgoritmo
The result has to be this
vlw for the help :)
Thank you very much! That second code of yours helped me a lot. Just something I had to change to work properly: line 8 - while (continue = "S") or (continue = "s") knife Just that to make it work. Thank you very much!
– yep
I am in doubt if Visualg differentiates between upper and lower case letters in this type of comparison. Take a test.
– anonimo