Documentos de Académico
Documentos de Profesional
Documentos de Cultura
//setw
using namespace std; // DECLARACION DE VARIABLES PUBLICAS int a, b,c,discri; double x1,x2; double PI=3.1416; int x,y,R,r; int main() { //DECLARACION de VARIABLES int opcion; //ASIGNACION cout << "HUAMANI JULIAN OLIVER // 2 CICLO // "<<"I-M3"<<endl<<endl; cout << "*************** MENU ************** "<<endl<<endl; cout << "1) ECUACION DE SEGUNDO GRADO"<<endl; cout << "2) PRODUCTO DE DOS NUMEROS"<<endl;
cout << "3) CALCULA EL VOLUMEN DE LA PIRAMIDE "<<endl; cout << "4) CALCULAR ENERGIA CINETICA"<<endl; cout << "5) EL AREA DEL TRIANGULO "<<endl; cout << "6) EL VOLUMEN DEL CILINDRO "<<endl; cout << "7) AREA DE UNA CORONA CIRCULAR "<<endl; cout << "8) AREA DE UN SECTOR CIRCULAR "<<endl; cout << "9) AREA DE UN TRAPECIO CIRCULAR "<<endl; cout << "10) CALCULO DEL ESFUERZO "<<endl<<endl; cout << "******** ESCOJA UNA OPCION ************** "<<endl; // ASIGNACION DE LA VARIABLE cin>> opcion; cout<<endl; //RESULTADO
switch (opcion) {
case 1: // ECUACION DE SEGUNDO GRADO { cout << " ECUACION DE SEGUNDO GRADO \n\n"; cout<<"INGRESE LA CONSTANTE A= ";cin>> a; cout<<endl; cout<<"INGRESE LA CONSTANTE B= ";cin>> b; cout<<endl;
cout<<"PRIMERA SOLUCION X1= ";cout<< x1; cout<<endl; cout<<"SEGUNDA SOLUCION X2= ";cout<< x2; cout<<endl; } else { cout<<"Solucin indeterminada "; cout<<endl; } } else { cout<<"No tiene Solucin"; cout<<endl;
break; }
case 2:// {
float n1=0.0,n2=0.0,p=0.0;
case 3: { double vp,n,m,k,D,F,J; string mensaje; mensaje = "*********CALCULA EL VOLUMEN DE LA PIRAMIDE********"; cout<<mensaje<<endl; mensaje ="ingrese variable x: "; cout<<mensaje<<endl; cin>>x; mensaje ="ingrese variable n: "; cout<<mensaje<<endl;
cin>>n; mensaje ="ingrese variable m: "; cout<<mensaje<<endl; cin>>m; mensaje ="ingrese variable k: "; cout<<mensaje<<endl; cin>>k;
break; case 4: {
break; } case 5: { cout << " AREA DEL TRIANGULO \n"; cout << " ***************************** \n"; //variables privadas float b1,h,AT; //instrucciones
cout<<"Este programa calcula el rea de un triangulo"<<endl; //enter cout<<"Digite el valor de la base"; cin>>b1; cout<<"Digite el valor de la altura"; cin>>h; //proceso AT=(b1*h)/2; cout<<"El rea del Triangulo es"<<AT; getch(); return(0); break; }
mensaje = "*********el volumen del cilindro********"; cout<<mensaje<<endl; mensaje ="ingrese radio : "; cout<<mensaje<<endl; cin>>r; mensaje ="ingrese la altura : "; cout<<mensaje<<endl; cin>>h;
mensaje = "*********AREA DE UNA CORONA CIRCULAR********"; cout<<mensaje<<endl; mensaje ="ingrese radio : "; cout<<mensaje<<endl; cin>>r; mensaje ="ingrese R : "; cout<<mensaje<<endl; cin>>R;
mensaje ="ingrese R : "; cout<<mensaje<<endl; cin>>R; mensaje ="ingrese variable x : "; cout<<mensaje<<endl; cin>>x; mensaje ="ingrese variable y: "; cout<<mensaje<<endl; cin>>y; Asc=(PI * R * R * x)/y;
case 9:
mensaje ="ingrese R : "; cout<<mensaje<<endl; cin>>R; mensaje ="ingrese radio : "; cout<<mensaje<<endl; cin>>r; mensaje ="ingrese variable x : ";
cout<<mensaje<<endl; cin>>x; mensaje ="ingrese variable y: "; cout<<mensaje<<endl; cin>>y; ATc= (PI * (R*R - r*r)*x)/y; cout<<"el area del sector circular es : "<<ATc<<endl; break; }
mensaje = "*********CALCULO DEL ESFUERZO********"; cout<<mensaje<<endl; mensaje ="ingrese LA FUERZA AXIAL: "; cout<<mensaje<<endl; cin>>P; mensaje ="ingrese AREA DE LA SECCION TRANSVERSAL: ";
cout<<mensaje<<endl; cin>>A; E=P/A; cout<<"el ESFUERZO es : "<<E<<endl; break; } //OTHERWISE default: cout << "GRACIAS POR SU VISITA\n"; } system("pause");