Buscar

4) Implement a procedure calcVar that receives an array of real numbers and its size N. The procedure should calculate and print the variance of th...

4) Implement a procedure calcVar that receives an array of real numbers and its size N. The procedure should calculate and print the variance of the distribution. Analyze the code below and choose the correct alternative:

The procedure calcVar calculates the variance of the distribution.
The variable var stores the variance of the distribution.
The variable med stores the mean of the distribution.
The variable temp stores the sum of the squared differences between each element and the mean of the distribution.
The procedure prints the variance of the distribution.
a) All affirmations are correct.
b) Only affirmations 1, 2 and 3 are correct.
c) Only affirmations 1, 4 and 5 are correct.
d) Only affirmations 1 and 5 are correct.

Essa pergunta também está no material:

AP 2   Computação I   2017 2
2 pág.

Computação Universidade Federal FluminenseUniversidade Federal Fluminense

💡 1 Resposta

User badge image

Ed Verified user icon

A alternativa correta é a letra c) Apenas as afirmações 1, 4 e 5 estão corretas. Explicação: - A afirmação 1 está correta, pois a função calcVar calcula a variância da distribuição. - A afirmação 2 está incorreta, pois a variável var não armazena a variância da distribuição, mas sim o desvio padrão. - A afirmação 3 não está presente no texto. - A afirmação 4 está correta, pois a variável temp armazena a soma dos quadrados das diferenças entre cada elemento e a média da distribuição. - A afirmação 5 está correta, pois a função imprime a variância da distribuição.

0
Dislike0

✏️ Responder

SetasNegritoItálicoSublinhadoTachadoCitaçãoCódigoLista numeradaLista com marcadoresSubscritoSobrescritoDiminuir recuoAumentar recuoCor da fonteCor de fundoAlinhamentoLimparInserir linkImagemFórmula

Para escrever sua resposta aqui, entre ou crie uma conta

User badge image

Outros materiais