Nothing Special   »   [go: up one dir, main page]

Programa de Hidrodinamica C++

Descargar como txt, pdf o txt
Descargar como txt, pdf o txt
Está en la página 1de 12

#include<stdio.

h>
#include<stdlib.h>
#include<conio.h>
#include<math.h>
#define pi 3.1416

main()
{

float v, t, G, V, A, d, dm, dme,g,h,Pma,dmen,Pme,Va,F;


int opc, resp;
system("color 0F");
textcolor(10);

int i;

for(i=1; i<=80; i++)


{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}

gotoxy(25,5);
printf("INSTITUTO POLITECNICO NACIONAL\n");
gotoxy(25,9);
cprintf("***** ***** * * * *****");
gotoxy(25,10);
cprintf("* * * * * *");
gotoxy(25,11);
cprintf("* * * * * * *");
gotoxy(25,12);
cprintf("*** ***** * * * ***");
gotoxy(25,13);
cprintf("* * * * * *");
gotoxy(25,14);
cprintf("* * * * * *");
gotoxy(25,15);
cprintf("***** ***** * * * *****");
gotoxy(30,18);
printf("Ingenieria Mecanica");
gotoxy(26,20);
printf("Fundamentos de Programacion");
getch();
clrscr();

for(i=1; i<=80; i++)


{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}

gotoxy(25,3);
printf("FUNDAMENTOS DE PROGRAMACION");
gotoxy(22,6);
printf("PROFESOR : ALEJANDRO MALAMOCO GOMEZ");
gotoxy(21,10);
printf("ALUMNO: JUAN DANIEL MARTINEZ IGNACIO");
gotoxy(33,14);
printf("GRUPO: 1MM3");
gotoxy(33,18);
printf(" PROGRAMA");
gotoxy(28,22);
printf(" *MOVIMIENTO CIRCULAR*");
getch ();
clrscr();

for(i=1; i<=80; i++)


{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}

do
{
printf("\n ELIJA EL CALCULO A REALIZAR");
printf("\n 1. GASTO");
printf("\n 2. VOLUMEN");
printf("\n 3. TIEMPO");
printf("\n 4. DIAMETRO");
printf("\n 5. VELOCIDAD EN EL ESTRECHAMIENTO");
printf("\n 6. VELOCIDAD DE UN LIQUIDO POR UN ORIFICIO");
printf("\n 7. VELOCIDAD DE AGUA");
printf("\n 8. FLUJO");
scanf("%d",&opc);
clrscr();
switch(opc)
{
case 1: //GASTO//
for(i=1; i<=80; i++)
{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}
for(i=1;i<=80;i++)
{
gotoxy(i,14);
printf("*");
//delay(10)
}

gotoxy(28,2);cprintf("\n CON QUE DATOS DESEA CALCULAR EL GASTO");


printf("\n 1. VOLUMEN Y TIEMPO");
printf("\n 2. VELOCIDAD Y AREA");
scanf("%d",&opc);
clrscr();
switch(opc)
{
case 1:
for(i=1; i<=80; i++)
{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}
for(i=1;i<=80;i++)
{
gotoxy(i,14);
printf("*");
//delay(10)
}

gotoxy(28,2);cprintf("\n INGRESE LOS SIGUIENTES DATOS");


printf("\n VOLUMEN");
scanf("%f",&v);
printf("\n TIEMPO");
scanf("%f",&t);
G=v/t;
gotoxy(35,15);cprintf("RESULTADOS");

printf("\n EL GASTO TIENE UN VALOR DE %.3fm3/s",G);


printf("\n DESEA REALIZAR OTRA OPERACION");
printf("\n 1. SI 2.NO");
scanf("%i",&resp);
clrscr();
break;

case 2:
for(i=1; i<=80; i++)
{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}
for(i=1;i<=80;i++)
{
gotoxy(i,14);
printf("*");
//delay(10)
}

gotoxy(28,2);cprintf("\n INGRESE LOS SIGUIENTES DATOS");


printf("\n VELOCIDAD");
scanf("%f",&V);
printf("\n AREA");
scanf("%f",&A);
G=V*A;
gotoxy(35,15);cprintf("RESULTADOS");
printf("\n EL GASTO TIENE UN VALOR DE %.4fm3/s",G);
printf("\n DESEA REALIZAR OTRA OPERACION");
printf("\n 1. SI 2.NO");
scanf("%i",&resp);
clrscr();
break;

}
break;

case 2: //VOLUMEN//
for(i=1; i<=80; i++)
{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}
for(i=1;i<=80;i++)
{
gotoxy(i,14);
printf("*");
//delay(10)
}

gotoxy(28,2);cprintf("\n INGRESE LOS SIGUIENTES DATOS");


printf("\n GASTO");
scanf("%f",&G);
printf("\n TIEMPO");
scanf("%f",&t);
v=G*t;
gotoxy(35,15);cprintf("RESULTADOS");

printf("\n EL VOLUMEN TIENE UN VALOR DE %.3fm3",v);


printf("\n DESEA REALIZAR OTRA OPERACION");
printf("\n 1. SI 2.NO");
scanf("%i",&resp);
clrscr();
break;

case 3: //TIEMPO//
for(i=1; i<=80; i++)
{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}
for(i=1;i<=80;i++)
{
gotoxy(i,14);
printf("*");
//delay(10)
}

gotoxy(28,2);cprintf("\n INGRESE LOS SIGUIENTES DATOS");


printf("\n VOLUMEN EN METROS CUBICOS");
scanf("%f",&v);
printf("\n GASTO EN METROS CUBICOS/SEGUNDO");
scanf("%f",&G);
t=v/G;
gotoxy(35,15);cprintf("RESULTADOS");

printf("\n EL TIEMPO ES: %.3fs",t);


printf("\n EL TIEMPO ES: %.3fmin",t/60);
printf("\n EL TIEMPO ES: %.3fh",t/3600);
printf("\n DESEA REALIZAR OTRA OPERACION");
printf("\n 1. SI 2.NO");
scanf("%i",&resp);
clrscr();
break;

case 4: //DIAMETRO//
for(i=1; i<=80; i++)
{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}
for(i=1;i<=80;i++)
{
gotoxy(i,14);
printf("*");
//delay(10)
}

gotoxy(28,2);cprintf("\n INGRESA LOS SIGUIENTES DATOS");


printf("\n GASTO");
scanf("%f",&G);
printf("\n VELOCIDAD");
scanf("%f",&V);
d=sqrt((4*G)/(V*pi));
gotoxy(35,15);cprintf("RESULTADOS");

printf("\n EL DIAMETRO TIENE UN VALOR DE %.3fm",d);


printf("\n DESEA REALIZAR OTRA OPERACION");
printf("\n 1. SI 2.NO");
scanf("%i",&resp);
clrscr();
break;

case 5: //VELOCIDAD EN EL ESTRECHAMIENTO//


for(i=1; i<=80; i++)
{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}
for(i=80; i>=1; i--)
{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}
for(i=1;i<=80;i++)
{
gotoxy(i,14);
printf("*");
//delay(10)
}

gotoxy(28,2);cprintf("\n INGRESA LOS SIGUIENTES DATOS");


printf("\n DIAMETRO MAYOR");
scanf("%f",&dm);
printf("\n VELOCIDAD EN EL DIAMETRO MAYOR");
scanf("%f",&V);
printf("\n DIAMETRO MENOR");
scanf("%f",&dme);
V=((pi/4)*(dm*dm)*V)/((pi/4)*(dme*dme));
gotoxy(35,15);cprintf("RESULTADOS");

printf("\n LA VELOCIDAD TIENE UN VALOR DE %.3fm/s",V);


printf("\n DESEA REALIZAR OTRA OPERACION");
printf("\n 1. SI 2.NO");
scanf("%i",&resp);
clrscr();
break;

case 6: //VELOCIDAD DE UN LIQUIDO POR UN ORIFICIO//


for(i=1; i<=80; i++)
{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}
for(i=24; i>=1; i--)
{
gotoxy(1,i);
printf("*");
//delay(10)
}
for(i=1;i<=80;i++)
{
gotoxy(i,14);
printf("*");
//delay(10)
}

gotoxy(28,2);cprintf("\n INGRESA LOS SIGUIENTES DATOS");


printf("\n GRAVEDAD");
scanf("%f",&g);
printf("\n ALTURA O PROFUNDIDAD");
scanf("%f",&h);
V=sqrt(2*g*h);
gotoxy(35,15);cprintf("RESULTADOS");

printf("\n LA VELOCIDAD TIENE UN VALOR DE %.3fm/s",V);


printf("\n DESEA REALIZAR OTRA OPERACION");
printf("\n 1. SI 2.NO");
scanf("%i",&resp);
clrscr();
break;

case 7: //VELOCIDAD DEL AGUA//


for(i=1; i<=80; i++)
{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}
for(i=1;i<=80;i++)
{
gotoxy(i,14);
printf("*");
//delay(10)
}

gotoxy(28,2);cprintf("\n INGRESA LOS SIGUIENTES DATOS");


printf("\n DIAMETRO MAYOR");
scanf("%f",&dm);
printf("\n PRESION DEL DIAMETRO MAYOR");
scanf("%f",&Pma);
printf("\n DIAMETRO MENOR");
scanf("%f",&dmen);
printf("\n PRESION DEL DIAMETRO MENOR");
scanf("%f",&Pme);
printf("\n DENSIDAD");
scanf("%f",&d);
Va=sqrt(((2/d)*(Pma-Pme))/(((((pi/4)*(dm*dm))/
((pi/4)*(dmen*dmen)))*(((pi/4)*(dm*dm))/((pi/4)*(dmen*dmen))))-1));
gotoxy(35,15);cprintf("RESULTADOS");

printf("\n LA VELOCIDAD TIENE UN VALOR DE %.3fm/s",Va);


printf("\n DESEA REALIZAR OTRA OPERACION");
printf("\n 1. SI 2.NO");
scanf("%i",&resp);
clrscr();
break;

case 8: //FLUJO//
for(i=1; i<=80; i++)
{
gotoxy(i,1);
printf("*");
//delay(10)
}

for(i=1; i<=24; i++)


{
gotoxy(80,i);
printf("*");
//delay(20)
}

for(i=80; i>=1; i--)


{
gotoxy(i,24);
printf("*");
//delay(10)
}

for(i=24; i>=1; i--)


{
gotoxy(1,i);
printf("*");
//delay(10)
}
for(i=1;i<=80;i++)
{
gotoxy(i,14);
printf("*");
//delay(10)
}

gotoxy(28,2);cprintf("\n INGRESA LOS SIGUIENTES DATOS");


printf("\n GASTO");
scanf("%f",&G);
printf("\n DENSIDAD");
scanf("%f",&d);
F=G*d;
gotoxy(35,15);cprintf("RESULTADOS");

printf("\n EL FLUJO TIENE UN VALOR DE %.3f Kg/s",F);


printf("\n DESEA REALIZAR OTRA OPERACION");
printf("\n 1. SI 2.NO");
scanf("%i",&resp);
clrscr();
break;
}
}while(resp==1);
getch();
return 0;
}

También podría gustarte