miércoles, 11 de enero de 2017

diagrama de flujo multiple 


#include <iostream>
using namespace std ;
int main ()
{
    int opcion;
    cout << "menu\n";
    cout << "1)velocidad\n";
    cout << "2)tiempo\n";
    cout << "3)distancia\n";
    cout << "4)fuerza\n";
    cout << "...elija una opcion";cin>>opcion;
switch(opcion)
{
case 1:
{  
     int e,t1;
     double v;
     cout<<"ingrese el espacio e: ";cin>>e;
     cout<<"ingrese el tiempo t: ";cin>>t1;
     if(t1 !=0)
     {
     v=e/t1 ;
     cout<<"la velocidad es: "<< v << endl;
     }
}; break;
case 2:
{
     int e,v1;
     double t1;
     cout<<"ingrese el espacio e: ";cin>>e;
     cout<<"ingrese el velocidad v1: ";cin>>v1;
     t1=e/v1 ;
     cout<<t1<<endl;
};break;
case 3:
{
     int v1,t,d;
     cout<<"ingrese el velocidad v1: ";cin>>v1;
     cout<<"ingrese el tiempo t: ";cin>>t;
     d=v1*t;
     cout<<d<<endl;
};break;
case 4:
{
     int m,a,f;
     cout<<"ingrese el masa m: ";cin>>m;
     cout<<"ingrese el aceleracion a: ";cin>>a;
    f=m*a;
     cout<<f<<endl;
};break;
}//fin del switch
system ("pause");
return 0;
}//fin del programa

No hay comentarios:

Publicar un comentario