elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Estamos en la red social de Mastodon


  Mostrar Temas
Páginas: [1]
1  Programación / Programación C/C++ / NECESITO AYUDA CON UNA ACTIVIDAD en: 3 Abril 2019, 05:04 am
SE DEJO REALIZAR UN PROGRAMA QUE DE UN PRINCIPIO CONTENGA UN MENU DONDE DA A ELEGIR *PERIMETRO Y *AREA O *SALIR, DESPUES CUANDO SE DE PERIMETRO ME SACARA OTRO MENU DONDE ME DE A ELEGIR ENTRE 5 FIGURAS Y AL ELEGIR ALGUNA DE LAS 5 FIGURAS (QUE SON TRIANGULO, PARALELOGRAMO,RECTANGULO,CUADRADO Y CIRCULO) ME LANZARA EL PERIMETRO Y LO MISMO PASA CON EL AREA.
Hasta ahorita es lo que llevo pero no logro hacer la eleccion de las figuras ¡Ayuda Porfa!



# include<iostream>
using namespace std;
class Operaciones
{
public:
   void menuMensaje1()
   {
   cout<<"Menu"<<endl<<"Presione la opcion que desee"<<endl<<"1.Perimetro"<<endl<<"2.Area"<<endl<<"3.Salir"<<endl;
   }
   void menuMensaje2()
   {
   cout<<"Figura a operar"<<endl<<"1.Triangulo"<<endl<<"2.Paralelogramo"<<endl<<"3.Rectangulo"<<endl<<"4.Cuadrado"<<endl<<"5.Circulo"<<endl;
   }
   void menuMensaje3()
   {
   cout<<"Triangulo"<<endl;
   }
   void perimTrian()
   {
   int a,b,c;
   cout<<"Ingresa el Primer valor"<<endl;
   cin>>a;
   cout<<"ingresa el segundo valor"<<endl;
   cin>>b;
   cout<<"ingresa el tercer valor"<<endl;
   cin>>c;
   int Resp=a+b+c;
   cout<<"El perimetro del triangulo es:"<<Resp<<endl;
   }
   void perimPara()
   {
      int a,b;
   cout<<"Ingresa el Primer valor"<<endl;
   cin>>a;
   cout<<"ingresa el segundo valor"<<endl;
   cin>>b;
   int Resp=2*a+b;
   cout<<"El perimetro del paralelogramo es:"<<Resp<<endl;
   }
void proSal()
   {
      cout<<"Saliendo del programa"<<endl;
   }
        };
int main()
{
   int a,b;
   bool salir=false;
   Operaciones menuPrin;
   do{
   menuPrin.menuMensaje1();
   cin>>a;
   if(a==1){ menuPrin.menuMensaje2();
    }
    if(a==1){ menuPrin.menuMensaje();
   }
   if(a==3){ menuPrin.proSal();
   }
    salir=true;
   }
   while(!salir);   
}
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines