top of page
FUNCIONES CON PARAMETROS

#include <iostream>

#include <math.h>

using namespace std;

int Opcion;

double m, a, d, i, s, p, R;

double RO=0.0175, FP=0.85;

double FUERZA (double j, double k);

double TRABAJO (double p, double q);

double CT (double x, double y, double z);

 

int main ()

{             

                               cout<< "MENU \n" ;

                               cout<< " 1. FUERZA \n" ;

                               cout<< " 2. TRABAJO \n" ;

                               cout<< " 3. CAIDA DE TENSION \n" ;

                               cout<< " INGRESE UNA OPCION:" ;

                               cin>> Opcion ;

 

switch ( Opcion )

{

  do

  {

                case 1:

                               {

                                               cout<< "INGRESE EL VALOR DE MASA:" , cin>> m;

                                               cout<< "INGRESE EL VALOR DE ACELERACION:" , cin>> a;

                                               R = FUERZA(m,a);

                                               cout<< "LA FUERZA ES:" << R ;

                                               cout<< "\n" ;

                               }; break;

               

                case 2:

                               {

                                               cout<< "INGRESE EL VALOR DE DISTANCIA:" , cin>> d;

                                               cout<< "INGRESE EL VALOR DE FUERZA:" , cin>> f;

                                               R = TRABAJO(d,f);

                                               cout<< "TRABAJO ES IGUAL A:" << R ;

                                               cout<< "\n" ;

                               }; break;

                              

                case 3:

                               {

                                               cout<< "INGRESE EL VALOR DE POTENCIA:" , cin>> p;

                                               cout<< "INGRESE EL VALOR DE CORRIENTE:" , cin>> i;

                                               cout<< "INGRESE EL VALOR DE LA SECCION DEL CONDUCTOR:" , cin>> s;

                                               R = CT(p, i, s);

                                               cout<< "LA CAIDA DE TENSION ES:" << R ;

                                               cout<< "\n" ;

                               }; break;

  } // FIN DEL SWITCH

                              

                system ( "pause" );

                return 0;

                }              //FIN DEL PROGRAMA

               

                double FUERZA (double j, double k);

                {

                               f = m * a;

                               return FUERZA;

                }

               

                double TRABAJO (double p, double q);

                {

                               w = d * f;

                               return TRABAJO;

                }

               

                double CAIDA_TENSION (double x, double y, double z);

                {

                               v = (RO * rc (3) * p * i * FP)/ s ;

                               return CAIDA_TENSION;

                }             

               

}

bottom of page