EVAP3

#include<iostream>
#include<math.h>
#include<conio.h>
using namespace std;
#define gravedad 9.8
int main()
{
    system ("color E4");
  int opcion;
  cout << "************** MENU **************\n " <<endl;
  cout << "1) AREA DEL CUADRADO " <<endl;
  cout << "2) VELOCIDAD CONSTANTE " <<endl;
  cout << "3) DISTANCIA I " <<endl;
  cout << "4) DISTANCIA II " <<endl;
  cout << "5) ENERGIA CINETICA " <<endl;
  cout << "6) ENERGIA POTENCIAL ELASTICA " <<endl;
  cout << "7) ENERGIA POTENCIAL GRAVITATORIA " <<endl;
  cout << "8) MODULO DE YOUNG " <<endl;
  cout << "9) TRABAJO " <<endl;
  cout << "10) PRESION HIDROSTATICA " <<endl;
  cin>> opcion;
  cout<<endl;

  switch (opcion)
  {

   
     case 1:
       {
       cout << " AREA DEL CUADRADO\n\n ";
       float l,AC;
       cout << "INGRESE EL LADO ";cin>> l; cout<<endl;
       AC = l*l;
       cout << " EL AREA DEL CUADRADO ES " <<AC;
       getch();
       return (0);
       break;
       }

     
     case 2:
       {
       cout << " VELOCIODAD CONSTANTE ";
       float tiempo, distancia, VC;
       cout << "INGRESE LA DISTANCIA ";cin>> distancia; cout<<endl;
       cout << "INGRESE EL TIEMPO ";cin>> tiempo; cout<<endl;
     
       VC = distancia / tiempo;
       cout << " LA VELOCIDAD CONSTANTE ES " <<VC;
       getch();
       return (0);
       break;
       }

     case 3:
        {
       cout << " DISTANCIA I ";
       float distancia, velocidad, tiempo, aceleracion ;
       cout << "INGRESE LA VELOCIDAD  ";cin>> velocidad; cout<<endl;
       cout << "INGRESE EL TIEMPO ";cin>> tiempo ; cout<<endl;
       cout << "INGRESE LA ACELERACION ";cin>> aceleracion ; cout<<endl;
       distancia = (velocidad * tiempo)+ (aceleracion * tiempo * tiempo / 2);
       cout << " LA DISTANCIA ES " << distancia;
       getch();
       return (0);
       break;
       }

     case 4:
       {
       cout << " DISTANCIA II  ";
       float distancia, Vinicial, Vfinal, tiempo;
       cout << "INGRESE LA V.INICAL  ";cin>> Vinicial; cout<<endl;
       cout << "INGRESE LA V.FINAL  ";cin>> Vfinal; cout<<endl;
       cout << "INGRESE EL TIEMPO  ";cin>> tiempo; cout<<endl;
       distancia = ( Vinicial + Vfinal )* tiempo /2;
       cout << " LA DISTANCIA  ES " << distancia;
       getch();
       return (0);
       break;
       }

     case 5:
       {
       cout << " ENERGIA CINETICA  ";
       float Ec, masa, velocidad ;
       cout << "INGRESE LA MASA  ";cin>> masa; cout<<endl;
       cout << "INGRESE LA VELOCIDAD ";cin>> velocidad; cout<<endl;
     
       Ec = (masa)*(velocidad*velocidad)/2;
       cout << " LA ENERGIA CINETICA ES " << Ec;
       getch();
       return (0);
       break;
       }
     
     case 6:
       {
       cout << " ENERGIA POTENCIAL ELASTICA ";
       float Epe, constante, variacion;
       cout << "INGRESE LA CONSTANTE ";cin>> constante; cout<<endl;
       cout << "INGRESE LA VARIACION ";cin>> variacion; cout<<endl;
     
       Epe= (constante)*(variacion)*(variacion)/2;
       cout << " LA ENERGIA POTENCIAL ELASTICA ES " << Epe;
       getch();
       return (0);
       break;
       }
     case 7:
       {
       cout << " ENERGIA POTENCIA GRAVITATORIA ";
       float Epg, masa, altura;
       cout << "INGRESE LA MASA ";cin>> masa; cout<<endl;
       cout << "INGRESE LA ALTURA ";cin>> altura; cout<<endl;
     
      Epg = ( masa ) * ( gravedad ) * ( altura );
       cout << " ENERGIA POTENCIAL GRAVITATORIA ES " <<Epg;
       getch();
       return (0);
       break;
       }
     case 8:
       {
       cout << " MODULO DE YOUNG ";
       float E, fuerza, longitud, deformacion, area ;
       cout << "INGRESE LA FUERZA ";cin>> fuerza; cout<<endl;
       cout << "INGRESE LA LONGITUD ";cin>> longitud; cout<<endl;
       cout << "INGRESE LA DEFORMACION ";cin>> deformacion ; cout<<endl;
       cout << "INGRESE EL AREA ";cin>> area; cout<<endl;
       E = (fuerza*longitud)/(deformacion*area);
       cout << " EL MODULO DE YOUNG ES " << E;
       getch();
       return (0);
       break;
       }

     case 9:
       {
       cout << " TRABAJO ";
       float W, fuerza, distancia;
       cout << "INGRESE LA FUERZA ";cin>> fuerza; cout<<endl;
       cout << "INGRESE LA DISTANCIA ";cin>> distancia; cout<<endl;
     
       W = (fuerza)*(distancia);
       cout << " EL TRABAJO ES " << W;
       getch();
       return (0);
       break;
       }
     case 10:
       {
       cout << " PRESION HIDROSTATICA ";
       float Ph, densidad, profundidad ;
       cout << "INGRESE DENSIDAD ";cin>> densidad; cout<<endl;
       cout << "INGRESE PROFUNDIDAD ";cin>> profundidad; cout<<endl;
     
       Ph= (densidad)*(gravedad)*(profundidad);
       cout << " LA PRESION HIDROSTATICA ES " << Ph;
       getch();
       return (0);
       break;
       }
     
       default:
        cout << " GRACIAS POR SU VISITA\n ";
       }
  system( "pause" );

  }

========================================================================

A CONTINUACION SI COMPILAMOS NOS SALDRA EL CUADRO DE MENU


EJEMPLO
elijamos la opcion 1
1) AREA DEL CUADRADO


 fin.

No hay comentarios:

Publicar un comentario