martes, 22 de octubre de 2013

1 parcial

1 parcial

2 parcial

using namespace std;
#include <iostream>
#include <conio.h>
#include <math.h>
#include <iomanip>
#define N 4
    int opcion,n,i,j,k;
    int G[4][4], H[4][4], K[4][4],Y[4][4];
    int A[4][4], B[4][4], C[4][4];
    int P[5][5],Q[5][5];
int main()
{
do
{
    cout << setw(57) << "************* MENU *************\n" << endl;
    cout << "1) PROBLEMA NUMERO 1" << endl;
    cout << "2) PROBLEMA NUMERO 2" << endl;
    cout << "3) PROBLEMA NUMERO 3" << endl;
    cout << "4) PROBLEMA NUMERO 4" << endl;
    cout << "POR FAVOR  INGRESE UNA OPCION / <0> PARA SALIR: "; cin>> opcion;
    cout << "\n\n";
    switch(opcion)
    {
    case 1:
         {
                 
         cout.setf(ios::fixed);
         cout.precision(3);
         cout << "********************************************************************************\n\n";
         cout << setw(50) << "PROBLEMA NUMERO 1" << endl;
         cout << setw(50) << "=================";
         cout << "\n\n";

cout<<"\n\n INGRESE EL TAMAÑO DE LA MATRIZ: ";cin>>n;

for(i =0; i < n; i++)
for(j =0; j < n;j++)
   {
     cout<<"\n Ingrese el valor del elemento: P["<<i+1<<"]["<<j+1<<"]= ";
     cin>>P[i][j];
   }


// Lectura de la Matriz P[m,n]
for(i =0; i < n; i++)
for(j =0; j < n;j++)
   {
     cout<<"\n P["<<i+1<<"]["<<j+1<<"]=  ";
     cout<<P[i][j];
   }

for(i =0; i < n; i++)
for(j =0; j < n; j++)
   {
       Q[i][j]= P[i][j];
   }

for(i=0; i < n; i++)
for(j =0; j < n; j++)
   {
     cout<<"\n Q["<<i+1<<"]["<<j+1<<"]=  ";
     cout<<Q[i][j];
   }
#define N 4
{
int I;
double max;
double min;
int numeros[N];
int i;
int maximo, minimo;
// INICIALIZO
minimo=1000;
maximo=0;
// LECTURA DE LOS ELEMENTOS VECTOR
for(i=0;i<N;i++)
{      cout<<"\n Ingrese el numero "<<i+1<<" = ";  cin>>(numeros[i]);}
// PROCESO calcula el MAXIMO Y EL MINIMO
for(i=0;i<N;i++)
         {
if(numeros[i]<minimo)
minimo=numeros[i];
if(numeros[i]>maximo)
maximo=numeros[i];
  }
cout<<"\n";
cout<<"EL MAXIMO  ES : "<<maximo;
cout<<"\n";
cout<<"EL MINIMO  ES : "<<minimo;
cout<<"\n";
//calculo  maximo
cout<<"ingresar =";cin>>I;
for(max=0;max<0;max++)
{   max=maximo;   }
cout<<" maximo es=\n"<<max<<",";
cout<< "FIN \n";

cout<<"ingresar =";cin>>I;
for(min=0;min<0;min++)
{     min=minimo;   }
cout <<"\n";
cout<<" minimo es=\n"<<min<<",";
cout<< "FIN \n";
getch();
}


getch();

                     
         }
    break;
    case 2:
         {
                  int i,j,k,n;
                  float x;
                  n=4;
                  int E[4][4],T[4][4],U[4][4];
                  cout.setf(ios::fixed);
                  cout.precision(2);
                  cout << "********************************************************************************\n\n";
                  cout << setw(50) << "PROBLEMA NUMERO 2" << endl;
                  cout << setw(50) << "=================";
                  cout << "\n\n";
                  cout << "Escribir un programa que llene una matriz de 4 por 4 de valores aleatorios" << endl;
    for (i = 0; i < n; i++)
    for (j = 0; j < n; j++)
    {
    cout<<"\n Ingrese el valor del elemento: A["<<i+1<<"]["<<j+1<<"]= ";
    cin>>E[i][j] ;
    }


// Lectura de la Matriz A[m,n]
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n A["<<i+1<<"]["<<j+1<<"]=  ";
     cout<<E[i][j] ;
   }

// calcular el producto de los elementos de las matrices
//A  en C
       cout<<"\n SUMA DE COLUMNAS\n\n";

         for (i = 0; i < n; i++)
         for (j = 0; j < n; j++)
         {
         C[i][j] = E[i][j];
       }
// VER EL RESULTADO DEL PRODUCTO DE SUS ELEMENTOS

// Lectura de la Matriz C[m,n]
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n C["<<i+1<<"]= ";
     cout<<C[i][j] ;
   }
   cout<<"\n SUMA DE COLUMNAS\n\n";
 
         for (i = 0; i < n; i++)
         for (j = 0; j < n; j++)
         {
         U[i][j] = E[i][j];
       }
// VER EL RESULTADO DEL PRODUCTO DE SUS ELEMENTOS

// Lectura de la Matriz C[m,n]
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n U["<<j+1<<"]= ";
     cout<<U[i][j] ;
   }


system("pause");
return 0;
}


    break;
    case 3:
         {
                  cout.setf(ios::fixed);
                  cout.precision(3);
                  cout << "********************************************************************************\n\n";
                  cout << setw(50) << "PROBLEMA NUMERO 3" << endl;
                  cout << setw(50) << "=================";
                  cout << "\n\n";
                 
                 
                 
                 
       
         }
    case 4:
         {
                 int i,j,k,n,x;
                  n=3;
                  int G[3][3], H[3][3], Y[3][3], K[3][3];
                  cout.setf(ios::fixed);
                  cout.precision(3);
                  cout << "********************************************************************************\n\n";
                  cout << setw(50) << "PROBLEMA NUMERO 4" << endl;
                  cout << setw(50) << "=================";
                  cout << "\n\n";
                 
                  cout <<"SUMA DE LA MATRIZ" << endl;
                  cout <<"RESTA DE LA MATRIZ" << endl;
                  cout <<"INVERSA DE LA MATRIZ" << endl;
                  cout << "TRANSPUESTA DE LA MATRIZ" << endl;
                  cout << "POR FAVOR  INGRESE UNA OPCION / <0> PARA SALIR: "; cin>> opcion;
                  cout << "\n\n";
                  switch(opcion)
                  {
                   case 1:
                        {
cout<<setw(50)<<"CALCULO DE LA RESTA DE LA MATRIZ"<<endl;                    
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n Ingrese el valor del elemento: A["<<i+1<<"]["<<j+1<<"]= ";
     cin>>A[i][j] ;
   }

//MATRIZ B
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n Ingrese el valor del elemento: B["<<i+1<<"]["<<j+1<<"]= ";
     cin>>B[i][j] ;
   }


// Lectura de la Matriz A[m,n]
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n A["<<i+1<<"]["<<j+1<<"]=  ";
     cout<<A[i][j] ;
   }

// Lectura de la Matriz B[m,n]
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n B["<<i+1<<"]["<<j+1<<"]=  ";
     cout<<B[i][j] ;
   }

// calcular el producto de los elementos de las matrices
//A y B en C

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
C[i][j] = A[i][j] + B[j][j];
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n C["<<i+1<<"]["<<j+1<<"]=  ";
cout<<C[i][j] ;
}
getch();
}      
 case 2:
     
{        
cout<<setw(50)<<"CALCULO DE LA RESTA DE LA MATRIZ"<<endl;
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: A["<<i+1<<"]["<<j+1<<"]= ";
cin>>A[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: B["<<i+1<<"]["<<j+1<<"]= ";
cin>>B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n A["<<i+1<<"]["<<j+1<<"]=  ";
cout<<A[i][j] ;
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n B["<<i+1<<"]["<<j+1<<"]=  ";
cout<<B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
C[i][j] = A[i][j] - B[j][j];
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n C["<<i+1<<"]["<<j+1<<"]=  ";
cout<<C[i][j] ;
}
}
case 3:
{
     cout<<"\n\n";
     cout<<"MATRIS INVERSA";
     cout<<"==============";
     cout<<"\n\n";
     for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: A["<<i+1<<"]["<<j+1<<"]= ";
cin>>A[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: B["<<i+1<<"]["<<j+1<<"]= ";
cin>>B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n A["<<i+1<<"]["<<j+1<<"]=  ";
cout<<A[i][j] ;
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n B["<<i+1<<"]["<<j+1<<"]=  ";
cout<<B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
C[i][j] = A[i][j] - B[j][j];
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n C["<<j+1<<"]["<<i+1<<"]=  ";
cout<<C[i][j] ;
}  
 }

case 4:
     cout<<setw(50)<<"MATRIS TRANSPUESTA";
     cout<<setw(50)<<"==================";
     cout<<"\n";
          cout<<"\n\n";
     cout<<"MATRIS INVERSA";
     cout<<"\n\n";
     for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: A["<<i+1<<"]["<<j+1<<"]= ";
cin>>A[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: B["<<i+1<<"]["<<j+1<<"]= ";
cin>>B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n A["<<i+1<<"]["<<j+1<<"]=  ";
cout<<A[i][j] ;
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n B["<<i+1<<"]["<<j+1<<"]=  ";
cout<<B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
C[i][j] = A[i][j] - B[j][j];
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n C["<<j+1<<"]["<<i+1<<"]=  ";
cout<<C[i][j] ;
}
}
getch();
}
    default:
                 cout << setw(50) << "grupo default de instrucciones"<<endl;
                 getch();
    }
 }while (opcion!=0);
getch();
}

             

2 parcial

using namespace std;
#include <iostream>
#include <conio.h>
#include <math.h>
#include <iomanip>
#define N 4
    int opcion,n,i,j,k;
    int G[4][4], H[4][4], K[4][4],Y[4][4];
    int A[4][4], B[4][4], C[4][4];
    int P[5][5],Q[5][5];
int main()
{
do
{
    cout << setw(57) << "************* MENU *************\n" << endl;
    cout << "1) PROBLEMA NUMERO 1" << endl;
    cout << "2) PROBLEMA NUMERO 2" << endl;
    cout << "3) PROBLEMA NUMERO 3" << endl;
    cout << "4) PROBLEMA NUMERO 4" << endl;
    cout << "POR FAVOR  INGRESE UNA OPCION / <0> PARA SALIR: "; cin>> opcion;
    cout << "\n\n";
    switch(opcion)
    {
    case 1:
         {
                 
         cout.setf(ios::fixed);
         cout.precision(3);
         cout << "********************************************************************************\n\n";
         cout << setw(50) << "PROBLEMA NUMERO 1" << endl;
         cout << setw(50) << "=================";
         cout << "\n\n";

cout<<"\n\n INGRESE EL TAMAÑO DE LA MATRIZ: ";cin>>n;

for(i =0; i < n; i++)
for(j =0; j < n;j++)
   {
     cout<<"\n Ingrese el valor del elemento: P["<<i+1<<"]["<<j+1<<"]= ";
     cin>>P[i][j];
   }


// Lectura de la Matriz P[m,n]
for(i =0; i < n; i++)
for(j =0; j < n;j++)
   {
     cout<<"\n P["<<i+1<<"]["<<j+1<<"]=  ";
     cout<<P[i][j];
   }

for(i =0; i < n; i++)
for(j =0; j < n; j++)
   {
       Q[i][j]= P[i][j];
   }

for(i=0; i < n; i++)
for(j =0; j < n; j++)
   {
     cout<<"\n Q["<<i+1<<"]["<<j+1<<"]=  ";
     cout<<Q[i][j];
   }
#define N 4
{
int I;
double max;
double min;
int numeros[N];
int i;
int maximo, minimo;
// INICIALIZO
minimo=1000;
maximo=0;
// LECTURA DE LOS ELEMENTOS VECTOR
for(i=0;i<N;i++)
{      cout<<"\n Ingrese el numero "<<i+1<<" = ";  cin>>(numeros[i]);}
// PROCESO calcula el MAXIMO Y EL MINIMO
for(i=0;i<N;i++)
         {
if(numeros[i]<minimo)
minimo=numeros[i];
if(numeros[i]>maximo)
maximo=numeros[i];
  }
cout<<"\n";
cout<<"EL MAXIMO  ES : "<<maximo;
cout<<"\n";
cout<<"EL MINIMO  ES : "<<minimo;
cout<<"\n";
//calculo  maximo
cout<<"ingresar =";cin>>I;
for(max=0;max<0;max++)
{   max=maximo;   }
cout<<" maximo es=\n"<<max<<",";
cout<< "FIN \n";

cout<<"ingresar =";cin>>I;
for(min=0;min<0;min++)
{     min=minimo;   }
cout <<"\n";
cout<<" minimo es=\n"<<min<<",";
cout<< "FIN \n";
getch();
}


getch();

                     
         }
    break;
    case 2:
         {
                  int i,j,k,n;
                  float x;
                  n=4;
                  int E[4][4],T[4][4],U[4][4];
                  cout.setf(ios::fixed);
                  cout.precision(2);
                  cout << "********************************************************************************\n\n";
                  cout << setw(50) << "PROBLEMA NUMERO 2" << endl;
                  cout << setw(50) << "=================";
                  cout << "\n\n";
                  cout << "Escribir un programa que llene una matriz de 4 por 4 de valores aleatorios" << endl;
    for (i = 0; i < n; i++)
    for (j = 0; j < n; j++)
    {
    cout<<"\n Ingrese el valor del elemento: A["<<i+1<<"]["<<j+1<<"]= ";
    cin>>E[i][j] ;
    }


// Lectura de la Matriz A[m,n]
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n A["<<i+1<<"]["<<j+1<<"]=  ";
     cout<<E[i][j] ;
   }

// calcular el producto de los elementos de las matrices
//A  en C
       cout<<"\n SUMA DE COLUMNAS\n\n";

         for (i = 0; i < n; i++)
         for (j = 0; j < n; j++)
         {
         C[i][j] = E[i][j];
       }
// VER EL RESULTADO DEL PRODUCTO DE SUS ELEMENTOS

// Lectura de la Matriz C[m,n]
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n C["<<i+1<<"]= ";
     cout<<C[i][j] ;
   }
   cout<<"\n SUMA DE COLUMNAS\n\n";
 
         for (i = 0; i < n; i++)
         for (j = 0; j < n; j++)
         {
         U[i][j] = E[i][j];
       }
// VER EL RESULTADO DEL PRODUCTO DE SUS ELEMENTOS

// Lectura de la Matriz C[m,n]
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n U["<<j+1<<"]= ";
     cout<<U[i][j] ;
   }


system("pause");
return 0;
}


    break;
    case 3:
         {
                  cout.setf(ios::fixed);
                  cout.precision(3);
                  cout << "********************************************************************************\n\n";
                  cout << setw(50) << "PROBLEMA NUMERO 3" << endl;
                  cout << setw(50) << "=================";
                  cout << "\n\n";
                 
                 
                 
                 
       
         }
    case 4:
         {
                 int i,j,k,n,x;
                  n=3;
                  int G[3][3], H[3][3], Y[3][3], K[3][3];
                  cout.setf(ios::fixed);
                  cout.precision(3);
                  cout << "********************************************************************************\n\n";
                  cout << setw(50) << "PROBLEMA NUMERO 4" << endl;
                  cout << setw(50) << "=================";
                  cout << "\n\n";
                 
                  cout <<"SUMA DE LA MATRIZ" << endl;
                  cout <<"RESTA DE LA MATRIZ" << endl;
                  cout <<"INVERSA DE LA MATRIZ" << endl;
                  cout << "TRANSPUESTA DE LA MATRIZ" << endl;
                  cout << "POR FAVOR  INGRESE UNA OPCION / <0> PARA SALIR: "; cin>> opcion;
                  cout << "\n\n";
                  switch(opcion)
                  {
                   case 1:
                        {
cout<<setw(50)<<"CALCULO DE LA RESTA DE LA MATRIZ"<<endl;                    
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n Ingrese el valor del elemento: A["<<i+1<<"]["<<j+1<<"]= ";
     cin>>A[i][j] ;
   }

//MATRIZ B
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n Ingrese el valor del elemento: B["<<i+1<<"]["<<j+1<<"]= ";
     cin>>B[i][j] ;
   }


// Lectura de la Matriz A[m,n]
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n A["<<i+1<<"]["<<j+1<<"]=  ";
     cout<<A[i][j] ;
   }

// Lectura de la Matriz B[m,n]
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
   {
     cout<<"\n B["<<i+1<<"]["<<j+1<<"]=  ";
     cout<<B[i][j] ;
   }

// calcular el producto de los elementos de las matrices
//A y B en C

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
C[i][j] = A[i][j] + B[j][j];
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n C["<<i+1<<"]["<<j+1<<"]=  ";
cout<<C[i][j] ;
}
getch();
}      
 case 2:
     
{        
cout<<setw(50)<<"CALCULO DE LA RESTA DE LA MATRIZ"<<endl;
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: A["<<i+1<<"]["<<j+1<<"]= ";
cin>>A[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: B["<<i+1<<"]["<<j+1<<"]= ";
cin>>B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n A["<<i+1<<"]["<<j+1<<"]=  ";
cout<<A[i][j] ;
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n B["<<i+1<<"]["<<j+1<<"]=  ";
cout<<B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
C[i][j] = A[i][j] - B[j][j];
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n C["<<i+1<<"]["<<j+1<<"]=  ";
cout<<C[i][j] ;
}
}
case 3:
{
     cout<<"\n\n";
     cout<<"MATRIS INVERSA";
     cout<<"==============";
     cout<<"\n\n";
     for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: A["<<i+1<<"]["<<j+1<<"]= ";
cin>>A[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: B["<<i+1<<"]["<<j+1<<"]= ";
cin>>B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n A["<<i+1<<"]["<<j+1<<"]=  ";
cout<<A[i][j] ;
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n B["<<i+1<<"]["<<j+1<<"]=  ";
cout<<B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
C[i][j] = A[i][j] - B[j][j];
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n C["<<j+1<<"]["<<i+1<<"]=  ";
cout<<C[i][j] ;
}  
 }

case 4:
     cout<<setw(50)<<"MATRIS TRANSPUESTA";
     cout<<setw(50)<<"==================";
     cout<<"\n";
          cout<<"\n\n";
     cout<<"MATRIS INVERSA";
     cout<<"\n\n";
     for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: A["<<i+1<<"]["<<j+1<<"]= ";
cin>>A[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n Ingrese el valor del elemento: B["<<i+1<<"]["<<j+1<<"]= ";
cin>>B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n A["<<i+1<<"]["<<j+1<<"]=  ";
cout<<A[i][j] ;
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n B["<<i+1<<"]["<<j+1<<"]=  ";
cout<<B[i][j] ;
}

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
C[i][j] = A[i][j] - B[j][j];
}
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
cout<<"\n C["<<j+1<<"]["<<i+1<<"]=  ";
cout<<C[i][j] ;
}
}
getch();
}
    default:
                 cout << setw(50) << "grupo default de instrucciones"<<endl;
                 getch();
    }
 }while (opcion!=0);
getch();
}

             

lunes, 3 de junio de 2013

EJERCICIOS II

using namespace std;
#include<iostream>
#include<math.h>
int main()

{
    int x=0,a=0,b=0,c=0,d=0,x1=0,x2=0,y1=0,y2=0,m=0,n=0,M=0,f=0;
    float J;
   
cout<<"MENU DE OPERACIONES DE FISICA \n\n";

cout<<"1)pendulo fisico o frecuencia angular\n";
cout<<"2)grado celsius\n";
cout<<"3)ley de columb\n";
cout<<"4)fuerza de newton\n";
cout<<"5)caida libre\n";
cout<<"6)viscosidad\n";
cout<<"7)campo electrico escalar\n";
cout<<"8)campo electrico vectorialmente\n";
cout<<"9)cantidad de calor \n";
cout<<"10)leyes de gases \n";
cout<<"11)choque inelastico\n";
cout<<"12)frecuencia oscilacion\n";
cout<<"13)modulo de loung\n";
cout<<"14)ley columb\n";
cout<<"15)carga electrica\n";

cout <<"INGRESE EL UNA OPCION:"; cin>>x; cout<<endl;

switch(x)
{    
case 1:
            {
    cout<<"pendulo fisico o frecuencia angular\n";
    cout<<"ingresar la masa=";cin>>m;
    cout<<"ingresar distancia=";cin>>d;  
    cout<<"ingresar gravedad=";cin>>a;
    cout<<"ingresar momento de inercia=";cin>>c;
    J=sqrt(m*a*d/c);
    cout<<"pendulo fisico o frecuencia angular="<<J;
    system("PAUSE");
    break;
    }
case 2:
     {
    cout<<"grado celsius\n";
    cout<<"ingresar Grado Fahrenheit";cin>>f;
    J=5*(f-32)/9;
    cout<<"grado celsius="<<J;    
    system("pause");
    break;
    }
case 3:
     {
     cout<<"COULOMB\n";
     cout<<"INGRESE LA CARGA=";cin>>a;
     cout<<"INGRESE LA K=";cin>>b;
     cout<<"INGRESE LA DISTANCIA=";cin>>d;
     J=(a*b)/pow(d,2);
     cout<<"COULOMB="<<J;
     system("pause");
     break;
                }
case 4:
     {
     cout<<"FUERZA DE NEWTON\n";
     cout<<"ingresar masa=";cin>>m;
     cout<<"ingresar frecuancia=";cin>>a;
     cout<<"ingresar desplazamiento=";cin>>c;
     J=m*(a*a)*c;
     cout<<"FUERZA DE NEWTON="<<J;
     system("pause");
     break;
     }      
case 5:
     {
     cout<<"caida libre o altura\n";
     cout<<"ingresar velocidad inicial=";cin>>x1;  
     cout<<"ingresar tiempo=";cin>>a;
     cout<<"ingresar gravedad=";cin>>c;
     J=x1+(c*a*a/2);
     cout<<"caida libre o altura="<<J;
     system("pause");
     break;
     }
                                                             
case 6:
     {
     cout<<"calculo  viscosidad\n";
     cout<<"ingresar area=";cin>>a;
     cout<<"ingresar coef. viscosidad=";cin>>n;
     cout<<"ingresar velocidad=";cin>>d;
     cout<<"ingresar altura=";cin>>c;
     J=n*a*d/c;
     cout<<"resultado de viscosidad es="<<J;
     system("PAUSE");
     break;
     }  
case 7:
     {
       cout<<"calculo campo electrico escalar\n";
     cout<<"ingresar carga puntual=";cin>>f;
     cout<<"ingresar distancia=";cin>>d;
     cout<<"ingresar constante k=";cin>>c;
     J=c*f/d*d;
     cout<<"resultado de campo electrico escalar="<<J;
     system("PAUSE");
     break;
     }

case 8:
     {
     cout<<"calculo campo electrico vectorialmente\n";
     cout<<"ingresar carga puntual=";cin>>d;
     cout<<"ingresar fuerza=";cin>>f;
     J=f/d;
     cout<<"resultado de campo electrico vectorialmente="<<J;
     system("PAUSE");
     break;
     }
case 9:
     {
     cout<<"calculo  cantidad de calor \n";
     cout<<"ingresar temperatura 1=";cin>>x1;
     cout<<"ingresar temperatura 2=";cin>>x2;
     cout<<"ingresar masa=";cin>>m;
     cout<<"ingresar calor especifico=";cin>>c;
     J=m*c*(x2-x1);
     cout<<"resultado de cantidad de calor="<<J;
     system("PAUSE");
     break;
     }
case 10:
     {
      cout<<"calculo de leyes de gases\n";
      cout<<"ingresar volumen=";cin>>d;
      cout<<"ingresar temperatura=";cin>>b;
      cout<<"ingresar constante r=";cin>>a;
      cout<<"ingresar  M gramos=";cin>>M;
      cout<<"ingresar m masa=";cin>>m;
      cout<<"ingresar numero de n=";cin>>n;
      J=(m/M)*n*a*b/d;
      cout<<"ingresar presion es="<<J;
      system("PAUSE");
      break;
      }
case 11:
      {
      cout<<"calculo de choque inelastico\n";
      cout<<"ingresar masa1=";cin>>x1;                            
      cout<<"ingresra masa2=";cin>>x2;
      cout<<"ingresar velocidad1=";cin>>y1;
      cout<<"ingresar velocidad2=";cin>>y2;
      J=x1*y1+x2*y2/x1+x2;
      cout<<"resultado velocidad final es ="<<J;
      system("PAUSE");
      break;
      }  
case 12:
      {
      cout<<"calculo de frecuencia de oscilacion\n\n";
      cout<<"ingresar masa m=";cin>>m;    
      cout<<"ingresar constante elastico k=";cin>>d;
      J=(sqrt(m/d))*2*3.1415;
      cout<<"resultado frecuencia de oscilacion es="<<J;
      system("PAUSE");
      break;
case 13:
     {
      cout<<"calculo  de modulo de loung\n\n";        
      cout<<"ingresar fuerza f=";cin>>f;
      cout<<"ingresar area a=";cin>>a;
      cout<<"ingresar variacion v=";cin>>d;
      cout<<"ingresar longitud l=";cin>>c;
      J=(f*c)/(d*a);
      cout<<"resultado es ="<<J;
      system("PAUSE");
      break;
      }
case 14:
     {
     cout<<"calculo de ley colmub\n\n";
     cout<<"ingresar carga q1=";cin>>x1;            
     cout<<"ingresar carga q2=";cin>>x2;
     cout<<"ingresar radio r=";cin>>d;
     cout<<"ingresar k=";cin>>c;
     J=c*(x1*x2/d);
     cout<<"resultado de ley de columb="<<J;
     system("PAUSE");
     break;
     }
case 15:
     {
     cout<<"calculo carga electrica\n\n";
     cout<<"ingresar el numero electron n=";cin>>a;
     cout<<"ingresar el numero entero e=";cin>>b;
     J=a*b;
     cout<<"resultado de n*e="<<J;
     system("PAUSE");
     break;
     }
               
    system("PAUSE");
}
}
}



EVALUACION PERMANENTE


https://docs.google.com/file/d/0B06wm79kVrjAWHVvTGFvYzlCOFk/edit?usp=sharing