laboratorio 2

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    int opcion;
    cout<<"MENU\n";
    cout<<"1.velocidad_angular\n";
    cout<<"2.periodo\n";
    cout<<"3.frecuencia_angular\n";
    cout<<"4.aceleracion_angular\n";
    cout<<"5.tabla_de_multiplicar\n";
    cout<<"Ingrese la opcion: ";cin>>opcion;
    switch(opcion)
 
    {
               
    case 1:
         {
                  double w,k,m;
                  cout<<"Ingrese el valor de k: ";cin>>k;
                  for(m=20;m<=50;m=m+2)
                  {
                                       w=sqrt(k/m);
                                       cout<<w<<endl;
                  }//FIN_for_m
               
         };break;
 
    case 2:
         {
                 double t,pi=3.14,m,k;
                 cout<<"Ingrese el valor de m: ";cin>>m;
                 for(k=0.025;k<=0.12;k=k+0.07)
                 {
                                              t=2*pi*sqrt(m/k);
                                              cout<<t<<endl;
                 }//FIN_for_k
         };break;
               
    case 3:
         {
                 double f,k,m,pi=3.14;
                 for(m=10;m<=30;m=m+2)
                 {
                                      for(k=0.0125;k<=0.185;k=k+0.01)
                                      {
                                                                     f=(1/(2*pi))*sqrt(k/m);
                                                                     cout<<f<<endl;
                                      }//FIN_for_k
                 }//FIN_for_m 
         };break;
       
    case 4:
         {
                 double a,wf,wi,t;
                 cout<<"Ingree el valor de t: ";cin>>t;
                 for(wf=20;wf<=50;wf=wf+3)
                 {
                                          for(wi=5;wi=20;wi=wi+1)
                                          {
                                                                 a=(wf-wi)/t;
                                                                 cout<<a<<endl;
                                                               
                                          }//FIN_for_wi
                 }//FIN_for_wf
         };break;
       
    case 5:
         {
                 double i,j;
                 for(j=1;j<=12;j=j+1)
                 {
                 cout<<endl;
                  cout<<"LA TABLA DE: "<<j<<endl;
                  cout<<"--------------"<<endl;
                 for(i=1;i<=10;i=i+1)
                  {
                    cout<<i<<" por "<<j<<" es = "<<i*j<<endl;
                  }//FIN_for_i
                 }//FIN_for_j
         };break;
    }
    system("pause");
    return 0;
}

No hay comentarios:

Publicar un comentario