Está en la página 1de 3

UNIVERSIDAD MILITAR NUEVA GRANADA

TALLER 13 - ARREGLOS
GRUPO B
DAYANNY ALAEXANDRA PINILLA VARGAS

MAYRA DANIELA SALAMANCA AGUIRRE

Plantilla:
/*problema
GRUPO B
Dayanny Pinilla y Daniela Salamanca
3 de mayo del 2022
*/
#include<iostream>
using namespace std;
int main()
{

cout << endl;


system("pause");

return 0;
}

/*Ejercicio 7
GRUPO B
Dayanny Pinilla y Daniela Salamanca
3 de mayo del 2022
*/
#include<iostream>
using namespace std;
int main()
{

int numero[10];
int i;
float numero_par,numero_impar;
float suma_numero = 0;
for (i = 0; i < 10; i++)
{
do
{
cout << "numero" << i + 1 << ":"; cin >> numero[i];
} while (numero[i] < 0);
}
for (i = 0; i < 10; i++)
{
suma_numero += numero[i];
}
cout << "\n numero final:" << endl;
for (i = 00; i < 10; i++)
{
cout << "\t " << numero[i];
numero_par = numero[i] % 2;
if (numero_par == 0)
{
numero_par = numero[i]*numero[i];
cout << ":" << numero_par<<":"<<endl;
}
else
{
numero_impar=pow(numero[i], 3);
cout << "__" << numero_impar << ":" << endl;
}
}
cout << endl;
cout << endl;
cout << endl;
system("pause");
return 0;
}

/*ejercicio 11
GRUPO B
Dayanny Pinilla y Daniela Salamanca
3 de mayo del 2022
*/
#include<iostream>
using namespace std;
int main()
{
int i, cont_rep = 0, cont_apro = 0, cont_debajo_pro = 0, cont_encima_pro = 0, pro = 0, num_notas =
0;
float notas[10], sumatoria = 0, nota_max = 0, nota_min = 5, nota_prom;
for (i = 0; i < 10; i++)
{
cout << "nota" << i + 1 << ":";
cin >> notas[i];
}

for (i = 0; i < 10; i++)


{
sumatoria = sumatoria + notas[i];
num_notas = num_notas + 1;
}
nota_prom = sumatoria / num_notas;

for (i = 0; i < 10; i++)


{
if (notas[i] < 3)
{
cont_rep = cont_rep + 1;
}
else
{
cont_apro = cont_apro + 1;
}
}

for (i = 0; i < 10; i++)


{
if (notas[i] < nota_prom)
{
cont_debajo_pro = cont_debajo_pro + 1;
}
else
{
cont_encima_pro = cont_encima_pro + 1;
}
}

for (i = 0; i < 10; i++)


{
if (notas[i] > nota_max)
{
nota_max = notas[i];
}
}
for (i = 0; i < 10; i++)
{
if (notas[i] < nota_min)
{
nota_min = notas[i];
}
}
for (i = 0; i < 10; i++)
{
cout << notas[i] << "\t";
}
cout << endl;
cout << "la nota promedio es:" << sumatoria / i << endl;
cout << "la nota maxima es:" << nota_max << endl;
cout << "la nota minima es:" << nota_min << endl;
cout << "notas aprobadas son:" << cont_apro << endl;
cout << "notas reprobadas son:" << cont_rep << endl;
cout << "notas encima del promedi:" << cont_encima_pro << endl;
cout << "notas por debajo del promedio" << cont_debajo_pro << endl;
system("pause");
return 0;
}

También podría gustarte