Questions tagged as 'portugol'

1
answer

What are the differences between repeat structures while, repeat and for?

Friends, I'm learning logic programming and came up with this doubt when I should use these commands and their differences.     
asked by 30.03.2016 / 23:01
1
answer

How to make a component with variables of different types?

algoritmo "Analisador Numérico Procedimento" // Função : Analisar Números com procedimentos LOL // Autor : Rodrigo Matos Aguiar // Data : 17/10/2016 // Seção de Declarações var Cont, NA, S, ND5, NN, SP: Inteiro // Cont - Contador, NA - Nú...
asked by 23.10.2016 / 00:58
1
answer

Array to solve hidden phrase puzzle

"You have two arrays letras = ["m", "D", " ", "e", " ", "G", "v", "e", "i", "e", " ", "r", "S", "G", "D", "u"]; caminho = [ 12, 7, 11, 9, 8, 4, 15, 0, 2, 13, 14, 5, 10, 1, 3, 6]; There is a hidden phrase that you have to find out, but n...
asked by 04.03.2016 / 17:21
2
answers

Return only positive results

I'm doing an exercise in visualg, in which the result can be both negative and positive, but I want the results only positive rather than negative. How to achieve this? What I have so far: algoritmo "semnome" // Função : // Autor : // Data : 0...
asked by 03.01.2018 / 22:11
1
answer

Return to the menu

I'm doing a college job and I'm having a hard time putting my ideas into practice. The job consists of a "car rental manager". My code so far is as follows: Algoritmo "semnome" Var Cliente, endereco: vetor[1..5] de caractere RG...
asked by 18.10.2017 / 00:42
1
answer

Test output value to see if it is INTEGER

I set the function below to check whether the output value is integer or real. funcao menu_8():inteiro var logaritmo :real inicio para contador de 0 ate 12 faca logaritmo <- ((log(i[contador])) / (log(2)))...
asked by 17.06.2016 / 16:32
1
answer

How to create an indeterminate algorithm using visualg?

I need to create an algorithm that returns different values each time I run, even though I get the same input values. It aims to solve an issue where I need to analyze the generation of a certain living being who is more likely to have no chi...
asked by 03.05.2016 / 20:16
1
answer

Portuguese doubts about assigning values to characters

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"...
asked by 08.05.2015 / 15:32
1
answer

Scroll through an array and validate repeated numbers

I am doing a final work in the first semester in BCC course and I need to do a Mega Sena algorithm with the following characteristics: Maximum of 10 players Each player must bet a minimum of 6 numbers and a maximum of 15 numbers Valid nu...
asked by 28.05.2014 / 00:27
1
answer

Why do you give an error in this type of comparison / choice?

escreval("Digite o consumo") leia(consumo) escolha consumo caso <= 100 escreval("Parabéns, voce e economico") caso >=101 e <200 escreval("Cuidado com o consumo") caso >200 escreval("Consumo execessivo"...
asked by 16.08.2018 / 00:07