top of page

FISICA DEL SONIDO

#include<iostream>
#include<math.h>
using namespace std;
double VEL(int T) ;
int Temp;
double R1,z; 
int VP(int i , int o ) ;
double Vi,Vo,i,o,R2,z2,B=0.5; 
double Int(double P , double A ) ;
int Pt,Am;
double z3,R3;
double Dec(int Ii,int Io );
double R4 , y , b ,z4 ;
int main()
 {
    int OPCION;
    
    cout<<"ONDAS SONORAS\n ";
    cout<<"*************\n ";
    cout<<"MENU \n ";
    cout<<"(1): Velocidad en cuanto a la temperatura \n ";
    cout<<"(2): Variacion de la presion \n ";
    cout<<"(3): Intensidad de onda \n ";
    cout<<"(4): Decibeles \n ";
    cout<<"INGRESE UNA OPCION: ";
    cin>>OPCION;
    switch(OPCION)
    {
    case 1:
        {cin>>Temp;
         R1=VEL(Temp);
         cout<<R1<<endl;
        };break;
     case 2:
        {cin>>Vo ; cin>>Vi ; 
         R2=VP(Vo,Vi);
         cout<<R2<<endl;
        };break;
     case 3:
        {cin>>Pt ; cin>>Am;
         R3=Int(Pt,Am);
         cout<<R3<<endl;
        };break;
     case 4:
         {cin>>y ;cin>>b;
           R4=Dec(y,o);
           cout<<R4<<endl;
         };break;
        
    }
    return 0;
}
//zona de funciones
double VEL(int T)
{
    z=331*sqrt(1+(Temp/273));
    return z;    
}//FIN VEL
int VP(int i, int o )
{
    z2=-B*(i/o);
    return z2;    
}//FIN VP

double Int(double P ,double A)
{
    z3= P/A;
    return z3;    
}//FIN Int
double Dec(int Ii ,int Io )
{
    z4=Ii/Io;
    return z4;    
}//FIN Aten    

© 2023 by Name of Site. Proudly created with Wix.com

  • Facebook Social Icon
  • Twitter Social Icon
  • Instagram Social Icon
bottom of page