top of page

cout<< "SEMANA: 8 FUNCIONES\n";

PROCESO DE ELABORACION EN C++

 

#include<iostream>
#include<math.h>
using namespace std;

//AREA DE DECLARACION UNIVERSAL
//---------------------------------------------------
double T;
double FRECUENCIA(int T);
double Z1,R1;
//---------------------------------------------------
int v,f;
double LON(int v,int f);
double Z2,R2;
//---------------------------------------------------
int p,d;
double PRO(int p,int d);
double Z3,R3;
//--------------------------------------------------
int t;
double V,B;
double VELS(int t);
double Z4,R4;
//--------------------------------------------------

//FIN DEL AREA DE DECLARACION UNIVERSAL

//AREA DEL MENU INTEACTIVO
int main()
{
 int opcion;
 do
 {    
 cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
 cout<<"***
FLORES NAVARRO J***"<<endl;
 cout<<"         -----------------MENU----------------\n";
 cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
 cout<<"1) FRECUENCIA \n";
 cout<<"2) LONGITUD DE ONDA \n";
 cout<<"3) PROPAGACION \n";
 cout<<"4) VELOCIDAD DEL SONIDO \n";
 cout<<"-----------------------------------------------------------\n";
 cout<<"INGRESE UNA OPCION: ";
 cin>>opcion;
 switch(opcion)

 {
     case 1:
        {
        cout<<"INGRESE PERIODO: ";
        cin>>T;
         R1=FRECUENCIA(T);
         cout<<"LA FRECUENCIA SERA:  "<<R1<<"(Hz)"<<endl<<endl;
        };break;
      
    
case 2:
          {
          cout<<"INGRESE VELOCIDAD: ";
          cin>>v;
          cout<<"INGRESE FRECUENCIA: ";
          cin>>f;
          R2=LON(v,f);
          cout<<"LA VELOCIDAD SERA:  "<<R2<<"(m)"<<endl<<endl;
          };break;
          
    
case 3:
          {
          cout<<"INGRESE PRESION: ";
          cin>>p;
          cout<<"INGRESE DENSIDAD: ";
          cin>>d;
          R3=PRO(p,d);
          cout<<"LA PROPAGACION SERA:  "<<R3<<endl<<endl;
          };break;
     
    
case 4:
          {
          cout<<"INGRESE TEMPERATURA DEL AMBIENTE: ";
          cin>>t;
          R4=VELS(t);
          cout<<"LA VELOCIDAD DEL SONIDO SERA:  "<<R4<<endl<<endl;
          };break; 
 } 
}
while(opcion!=0);
return 0;
}

//FIN DEL AREA DE MENU
//------------------------------------------------
double FRECUENCIA(int T)
{
     Z1=1/T;
     return Z1;    
}
//------------------------------------------------
double LON(int v,int f)
{
     Z2=v/f;
     return Z2;
}
//------------------------------------------------
double PRO(int p,int d)
{
     Z3=sqrt((1.4*p)/d);
     return Z3;
}
//------------------------------------------------
double VELS(int t)
{
     V=331.3;
     B=0.606;
     Z4=V+B*t;
     return Z4;
}
//------------------------------------------------

//AREA DE FUNCIONES

TRABAJO DE INVESTIGACIÓN
-----El SONIDO----
VIDEO EXPLICATIVO DE FUNCIONES

Contactame:

Déjame tu opinión:

bottom of page