BIENVENIDO A MI BLOG AQUI PODRAN VER ARCHIVOS Y CONTENIDOS DEL CURSO DE LENGUAJE DE PROGRAMACIÓN I
LABORATORIO NÚMERO 2
VECTORES + MATRICES
#include<iostream>
#include<math.h>
using namespace std;
int i, j, h, r, Den, Vel, Con, fff;
double T, DentroRaiz, V, D, HG, HP, HK, hh;
const double pi=3.1416, g=9.8, Q=1000;
const int p=6, n=3, m=2;
int M[n][m];
int X[p];
void Espaciorecorrido();
void Unidaddepresion();
void FuerzaAceleracion();
void ConservacionDeEnergia();
int main ()
{
int opcion;
do
{
cout<<" 1) Hallar el Espacio \n";
cout<<" 2) Hallar la Unidad de Presion \n";
cout<<" 3) FUERZA Y ACELERACION EN UN ELEMENTO DE FLUIDO \n";
cout<<" 4) CONSERVACION DE LA ENERGIA (BERNOULLI) \n\n";
cout<<" DIGITE <0> PARA SALIR \n\n";
cout<<"ELIJA UNA OPCION: ";
cin>>opcion;
cout<<"************************************************\n";
cout<<"\n\n";
switch (opcion)
{
case 1:
{
cout<<"******* Espacio recorrido ******\n\n";
Espaciorecorrido();
cout<<"***********************************************\n\n";
}
break;
case 2:
{
cout<<"******* Unidad de presion ***************\n\n";
Unidaddepresion();
cout<<"***********************************************\n\n";
}
break;
case 3:
{
cout<<"** FUERZA y ACELERACION EN UN ELEMENTO DE FLUIDO **\n\n";
FuerzaAceleracion();
cout<<"*********************************\n\n";
}
break;
case 4:
{
cout<<"**** CONSERVACION DE LA ENERGIA (BERNOULLI) ****\n\n";
ConservacionDeEnergia();
cout<<"************************************************\n\n";
}
break;
}
}while (opcion !=0);
cout<<endl;cout<<"\n";
system("pause");
return 0;
}
void Espaciorecorrido()
{
cout<<endl;
cout<<"Ingresar la Velocidad: ";
cin>>h;
cout<<"Ingresar la Tiempo: ";
cin>>fff;
cout<<endl;
for(i=1; i<=n; i++)
for(j=1; j<=m; j++)
{
cout<<"\n";
cout<<"Ingrese valores del metacentro: ";
cin>>M[i][j];
T = ((M[i][j])*(fff * h));
cout<<"El espacio es: "<<T;
}
cout<<endl;
}
void Unidaddepresion()
{
cout<<endl;
cout<<"HALLANDO LAS VELOCIDADES: ";
cout<<"Ingresar Cuantos metros tiene: ";
cin>>hh;
cout<<endl;
for(i=1; i<=n; i++)
for(j=1; j<=m; j++)
{
cout<<"\n";
cout<<"Ingrese valores de las areas: ";
cin>>M[i][j];
V = (M[i][j] / hh);
cout<<"La Unidad de presion es: "<<V;
}
cout<<endl;
}
void FuerzaAceleracion()
{
cout<<endl;
cout<<"Ingresar el radio: \n\n";
cin>>r;
cout<<"\nHALLANDO LA DISTANCIA: ";
cout<<endl;
for(i=1; i<=p; i++)
{
cout<<"\n";
cout<<"Ingrese las velocidades angulares: ";
cin>>X[p];
D=(pow(X[p],2))*(pow(r,2))/2*g;
cout<<"La distancia es: "<<D;
}
cout<<endl;
}
void ConservacionDeEnergia()
{
cout<<endl;
cout<<"Ingresar la constante: \n\n";
cin>>Con;
cout<<"Ingresar la densidad: \n\n";
cin>>Den;
cout<<"Ingresar la velocidad: \n\n";
cin>>Vel;
cout<<"\nHALLANDO LA DISTANCIA: ";
cout<<endl;
for(i=1; i<=p; i++)
{
cout<<"\n";
cout<<"Ingrese la presion: ";
cin>>X[p];
HP=X[p]/(Den*g); //altura de presion
HK=pow(Vel,2)/2*g;//altura cinetica
HG=(Con-HP)-HK;
cout<<"La altura geometrica es: "<<HG;
}
cout<<endl;
}
Suscribirse a:
Entradas (Atom)
No hay comentarios:
Publicar un comentario