calculadora.cpp - #include <stdio.h>#include <stdlib.h>#include <math.h>#define SIZE 5 int printf\n\n\nQUE DESEAS REALIZAR\n printf"1 printf"2 printf"3

• Homework Help
• 5

This preview shows page 1 - 3 out of 5 pages.

#include <stdio.h> #include <stdlib.h> #include <math.h> #define SIZE 5 int MUESTRAMENUESTADISTICO(){ printf("\n\n\nQUE DESEAS REALIZAR\n"); printf("1) PROMEDIO\n"); printf("2) VARIANZA\n"); printf("3) MODA\n"); printf("4) MEDIANA\n"); printf("5) DESVIACION ESTANDAR\n"); printf("6) DISTRIBUCION ACUMULATIVA\n"); printf("7) MAXIMO\n"); printf("8) MINIMO\n"); printf("9) INTRODUCIR DATOS\n"); int i; scanf("%d", &i); return i; } void METEDATOS( int datos[]){ for (int i = 0; i < SIZE; i++){ printf("Introduce el dato %d: ", i); scanf("%d", &datos[i]); } return; } float PROMEDIO( int datos[]){ float suma = 0; for (int i = 0; i < SIZE; i++){ suma = suma + datos[i]; } return suma / SIZE; } float VARIANZA( int datos[]) { float varianza = 0; float p = PROMEDIO(datos); for (int i = 0; i < SIZE; i++) { float rango;

Subscribe to view the full document.

rango = pow(datos[i] - p,2); varianza = varianza + rango; } return varianza / SIZE; } float MODA(int datos[]){ int auxiliar[SIZE]; for (int i = 0; i < SIZE; i++){ auxiliar[i]=0; } int numero=0; int posicion=0; int mayor=0 ; int posicionmayor=0; int bandera=0; float suma=0 ; for (int i = 0; i < SIZE; i++){ numero = datos[i]; posicion = i; for(int j= i; j < SIZE; j++) { if( datos[j] == numero ) auxiliar[posicion]++; } } mayor=auxiliar[0];
• Spring '18
• ALBERTO

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern