TrabalhosGratuitos.com - Trabalhos, Monografias, Artigos, Exames, Resumos de livros, Dissertações
Pesquisar

O DESENVOLVIMENTO DE UM ALGORITMO DE ANÁLISE DA MÉDIA, MEDIANA, MODA E DESVIO PADRÃO, VARIÂNCIA

Por:   •  20/11/2017  •  Pesquisas Acadêmicas  •  948 Palavras (4 Páginas)  •  855 Visualizações

Página 1 de 4

UNIVERSIDADE PAULISTA “CAMPUS RANGEL”

U N I P

CIÊNCIA DA COMPUTAÇÃO

“DESENOLVIMENTO DE UM ALGORITMO DE ANÁLISE DA MÉDIA, MEDIANA, MODA E DESVIO PADRÃO, VARIÂNCIA”

[pic 2][pic 3]

ATIVIDADE PRATICA SUPERVISIONADA A P S

Aluno:        RA: D117FH-3

Aluno:        RA: D07GFA-1

Aluno:         RA: B508AC-8

Aluno:        RA: C56BGE-3

Orientador:

Santos-SP, 2017


  1. RELATORIOS DE FUNCIONAMENTO DO PROGRAMA.

1. package aps2; 2.

  1. import java.text.DecimalFormat;
  2. import java.util.Scanner; 5.

6.

7. public class Aps2 { 8.

  1. public static void main(String[] args) {
  2. int n,k ;
  3. double vetor[],auxiliar,at,ic,vetorli[],li,vetorfi[],fri[],xi[],fac[],fad[]; 12.
  1. Scanner entrada = new Scanner(System.in);
  2. System.out.print("Digite a quantidade de dados a serem analisados: ");
  3. n=entrada.nextInt();
  4. vetor=new double[n];
  5. for(int i=0; i<n;i++)

18.        {

19.        System.out.print("Digite o Dado: "); 20.

21.        vetor[i]=entrada.nextDouble(); 22.

23.        }

24.        for(int i=0; i<n; i++)

25.        {

26.        for(int j=0; j<n; j++)

27.        {

28.        if(vetor[j]>vetor[i])

29.        {

  1. auxiliar=vetor[i];
  2. vetor[i]=vetor[j];
  3. vetor[j]=auxiliar;

33.        }

34.        }

35.        }

  1. at=vetor[n-1]-vetor[0];
  2. k=(int) Math.round(Math.sqrt(n));
  3. ic=Math.round(at/k);
  4. vetorli=new double[k];
  5. vetorfi=new double[k];
  6. xi=new double[k];
  7. fri=new double[k];
  8. fac=new double[k];
  9. fad=new double[k];
  10. li=vetor[0];
  11. vetorfi[0] =0;
  12. double soma=0;
  13. double moda=xi[0];
  14. double maior=vetorfi[0];
  15. double mediana=0;
  16. double desvio;
  17. double variancia[]=new double[k];


  1. double soma2=0;
  2. DecimalFormat formatar =new DecimalFormat("0.00"); 55.

56.        for(int i=0; i<k; i++)

57.        {

  1. li=li+ic;
  2. vetorli[i]=li;

62.        }

63.

64.

65.        for(int i=0; i<k; i++)

66.        {

67.        for(int j=0; j<n; j++)

68.        {

69.        if(vetor[j]>=(vetorli[i]-ic) && vetor[j]<vetorli[i])

70.        {

71.

72.        vetorfi[i] = vetorfi[i] + 1;

73.

74.        }

75.        }

76.        }

77.

78.

79.

  1. System.out.println("IC \t\t Fi\tFri\tF%i\tXi\tFac\tFad\tXi.Fi");
  2. for(int i=0; i<k; i++)

82.        {

...

Baixar como (para membros premium)  txt (5.3 Kb)   pdf (140.6 Kb)   docx (26.8 Kb)  
Continuar por mais 3 páginas »
Disponível apenas no TrabalhosGratuitos.com