Command while in code in VisualG [closed]

closed . This question needs to be more objective and is not currently accepting answers.

want to improve this question? update the question to focus on just one problem when edit it .

Closed 1 year ago .

improve this question

Good evening guys. I have this code done and I need to do what the exercise is asking for, but I'm not understanding and I don't know how to do it. The only tip I have is that you should use the command while . The key used to place a new order (can be one, two, or more orders) is the "s"key. To close the order, the "n" key is used. Does anyone have any tips on how the code should look?

Thank you right now. Exercise follows:

1) Write an algorithm that at the end of the display on the screen of the customer's choice asks if he would like to place another order. If the customer wants to place a new order, he must press the "S" key" (without quotation marks and lowercase). If you do not want to place a new order, you must press the "n" key (without quotation marks and lowercase), then the order will be finalized.

Var
// Seção de Declarações das variáveis 
opcao, quantidade: inteiro
valor: real
Inicio
// Seção de Comandos, procedimento, funções, operadores, etc...

escreval ("   Lanchonete Central   ")
escreval ("   ------------------   ")
escreval (" ***Opções de lanches*** ")
escreval (" [1] - Torrada Simples -> R$ 4,00")
escreval (" [2] - Torrada Completa -> R$ 5,00")
escreval (" [3] - Cachorro Quente Simples -> R$ 5,00")
escreval (" [4] - Cachorro Quente Completo -> R$ 6,00")
escreval (" [5] - Cheeseburger Completo -> R$ 8,00")
escreval ("Digite a opção escolhida")
leia (opcao)
escreval ("Qual a quantidade desejada?")
leia (quantidade)

escolha opcao
caso 1
valor:=quantidade*4
escreval ("O lanche escolhido foi ",quantidade," Torrada Simples(s) e custará R$ ", valor,",00")
caso 2
valor:=quantidade*5
escreval ("O lanche escolhido foi ",quantidade," Torrada Completa(s) e custará R$ ", valor,",00")
caso 3
valor:=quantidade*5
escreval ("O lanche escolhido foi ",quantidade," Cachorro Quente Simples(s) e custará R$ ", valor,",00")
caso 4
valor:=quantidade*6
escreval ("O lanche escolhido foi ",quantidade," Cachorro Quente Completo(s) e custará R$ ", valor,",00"
caso 5
valor:=quantidade*8
escreval ("O lanche escolhido foi ",quantidade," Cheeseburger Completo(s) e custará R$ ", valor,",00")


fimescolha

Fimalgoritmo
Author: toguchi, 2019-12-17