1.
Convertir de pesos a euros y a dolares
/*comentario de bloque
convertidor
codigo 2903894 Sergio Gutierrez
ing. industrial grupo B */
#include<iostream> //comentario directiva preprocesador
using namespace std; // directiva preprocesador
int main()//funcion principal
{// inicio
int euro = 0, dolar = 0, num1 = 0; //definicion de varibles tipo integer
cout << "\t\t\tIndicar valor en pesos\n";//mostrar mensaje
cin >> num1; //leer datos
dolar = num1 / 3000; //hacer euro
euro = num1 / 3500; //hacer dolar
cout << "\t\t\tel resulatdo de la euro es :" << euro << endl; // mostrar
resulatdo
cout << "\t\t\tel resulatdo de la dolar es :" << dolar << endl; // mostrar
resulatdo
return 0;// valor que restorna la funci�n
system("pause");//stop sobre consola
}// fin
===================================================================================
=======================================================
2. Digitar dos numeros y hacer suma, resta, multiplicacion y division
/*Comentario de bloque
sumar, mutiplicar, dividir y restar dos numeros
Ing.industrial grupo B
codigo 2903894 Sergio Gutierrez */
#include<iostream> //comentario directiva preprocesador
using namespace std; // directiva preprocesador
int main()//funcion principal
{// inicio
int num1 = 0, num2 = 0; //definicion de varibles tipo integer
float suma = 0.0;// definicon varibale tipo float
float resta = 0.0;// deficion de varible tipo float
float multiplicacion = 0.0;// deficion de varible tipo float
float division = 0.0;// deficion de varible tipo float
cout << "\t\t\tIndicar dos numeros\n";//mostrar mensaje
cin >> num1; //leer datos
cin >> num2;// leer datos
suma = num1 + num2; //hacer suma
resta = num1 - num2; //hacer resta
multiplicacion = num1 * num2; //hcaer multiplicacion
division = num1 / num2; //hacer division
cout << "\t\t\tel resulatdo de la suma es :" << suma << endl; // mostrar
resulatdo
cout << "\t\t\tel resulatdo de la resta es :" << resta << endl; // mostrar
resulatdo
cout << "\t\t\tel resulatdo de la multiplicacion es :" << multiplicacion <<
endl; // mostrar resulatdo
cout << "\t\t\tel resulatdo de la division es :" << division << endl; //
mostrar resulatdo
return 0;// valor que restorna la funci�n
system("pause");//stop sobre consola
}// fin
===================================================================================
==============================================================
3. Calcular promedio de cinco numeros
/*comentario de bloque
sacar promedio 5 numeros
codigo 2903894 Sergio Gutierrez
Ing.Industrial Grupo B*/
#include<iostream>//comentario Directiva preprocesador
using namespace std; // Directiva preprocesador
int main()// funcion principal
{ // inicio
float num1 = 0.0, num2 = 0.0, num3 = 0.0, num4 = 0.0, num5 = 0.0;//definicion
variables tipo integer
float suma = 0.0;// definicion variable tipo float
float promedio = 0.0;// definicion variable tipo float
cout << "\t\t\tIndicar cinco numeros enteros\n";//mostrar mensaje
cin >> num1;// leer datos
cin >> num2;// leer datos
cin >> num3;// leer datos
cin >> num4;// leer datos
cin >> num5;// leer datos
suma = num1 + num2 + num3 + num4 + num5; // hacer suma
promedio = suma / 5;// hacer division
cout << "\t\t\tEl resultado del promedio es: " << promedio << endl; //mostrar
resultado
system("pause"); // Stop sobre consola
return 0; // valor que retorna la funcion
} // fin
===================================================================================
====================================================
4. Programa que halla valor de y
/*comentario de bloque
valor de y
codigo 2903894 Sergio Gutierrez
Ing.Industrial Grupo B*/
#include<iostream>//comentario Directiva preprocesador
using namespace std; // Directiva preprocesador
int main()// funcion principal
{ // inicio
int R = 0;//definicion variables tipo integer
float y = 0.0, y1 = 0, y2 = 0, y3 = 0;// definicion variable tipo float
cout << "\t\t\tIndicar valor R\n";//mostrar mensaje
cin >> R;// leer datos
y1 = 3 * R; //multiplicar n�mero
y2 = 7 * R; //multiplicar n�mero
y3 = y1 + y2 + 2; //sumar n�mero
y = y3 - 15; //restar n�mero
cout << "\t\t\tEl resultado del valor de y es: " << y << endl; //mostrar resultado
system("pause"); // Stop sobre consola
return 0; // valor que retorna la funcion
} // fin
===================================================================================
=========================================================
5. programa que calcula el salario neto
/*salario trabajor
codigo 2903894 Sergio gutierrez
ing.industrial grupo B */
#include<iostream> //comentario directiva preprocesador
using namespace std; // directiva preprocesador
int main()//funcion principal
{// inicio
int horas = 0, valor = 0; //definicion de varibles tipo integer
float valorhoras = 0.0;// deficion de varible tipo float
float salario = 0.0;// deficion de varible tipo float
float interes = 0.0;// deficion de varible tipo float
cout << "\t\t\tindicar valor hora\n";//mostrar mensaje
cin >> horas; //leer datos
cout << "\t\t\tindicar cuantas horas\n";//mostrar mensajes
cin >> valor;// leer datos
valorhoras = horas * valor; //hacer suma
interes = valorhoras * 0.02; //hacer resta
salario = valorhoras - interes; //hcaer multiplicacion
cout << "\t\t\tel resultado valor hora es :" << valorhoras << endl; //
mostrar resulatdo
cout << "\t\t\tel resulatdo del interes es :" << interes << endl; // mostrar
resulatdo
cout << "\t\t\tel salario neto es :" << salario << endl; // mostrar resulatdo
return 0;// valor que restorna la funci�n
system("pause");//stop sobre consola
}// fin
===================================================================================
===========================================================
6.calcular el precio con descuento de un articulo
/*comentario de bloque
calcular el valor de un articulo con un 20% de descuento y 19% de IVA
codigo 2903894 Sergio Gutierrez
Ing.Industrial Grupo B*/
#include<iostream>//comentario Directiva preprocesador
using namespace std; // Directiva preprocesador
int main()// funcion principal
{ // inicio
int precio = 0;//definicion variables tipo integer
float suma = 0.0, descuento = 0, iva = 0, subtotal = 0, total = 0;// definicion
variable tipo float
cout << "\t\t\tIndicar precio\n";//mostrar mensaje
cin >> precio;// leer datos
descuento = precio * 0.2; //multiplicar n�mero
iva = precio * 0.15; //multiplicar n�mero
subtotal = precio - descuento; //restar n�mero
total = subtotal + iva; //sumar n�mero
cout << "\t\t\tEl precio total con descuento es " << total << endl; //mostrar
resultado
system("pause"); // Stop sobre consola
return 0; // valor que retorna la funcion
} // fin
===================================================================================
===============================================================
7. determinar diferentes enunciados
/*comentario de bloque
diferentes enunciados
codigo 2903894 sergio gutierrez
ing. industrial grupo B */
#include<iostream> //comentario directiva preprocesador
using namespace std; // directiva preprocesador
int main()//funcion principal
{// inicio
float num1 = 0.0, num2 = 0.0; //definicion de varibles tipo integer
float division = 0.0;// definicon varibale tipo float
float residuo = 0.0;// deficion de varible tipo float
float multiplicacion = 0.0;// deficion de varible tipo float
float resta = 0.0;// deficion de varible tipo float
float cubo = 0.0;// deficion de varible tipo float
float raiz2 = 0.0;// deficion de varible tipo float
float raiz3 = 0.0;// deficion de varible tipo float
double seno = 0.0;// deficion de varible tipo float
bool logico, logico1;
int a = 7, b = 4, c = 8;
cout << "\t\t\tIndicar dos numeros\n";//mostrar mensaje
cin >> num1; //leer datos
cin >> num2;// leer datos
division = num1 / num2; //hacer division
residuo = 12 / 5; //hacer residuo
multiplicacion = 4 * 6 ; //hacer multiplicacion
resta = multiplicacion - 3; //hacer resta
cubo = 11 * 11 * 11; //hacer cubo
raiz2 = pow ( 1331, (double) 1/3 ); //hacer raiz cubica
raiz3 = sqrt(25); //hacer raiz cuadrada
seno = sin(2 * 3.141592 / 6);// sacar coseno
logico = a > b, b < a;
// hacer operacion logica
cout << "\t\t\tel resulatdo de la divison es :" << division << endl; // mostrar
resulatdo
cout << "\t\t\tel resulatdo de la residuo es :" << residuo << endl; // mostrar
resulatdo
cout << "\t\t\tel resulatdo de la multiplicacion de (6*4)-3 es :" << resta << endl;
// mostrar resulatdo
cout << "\t\t\tel el cubo de 11 es :" << cubo << endl; // mostrar resulatdo
cout << "\t\t\tel resulatdo de la raiz cubica de 1331 es :" << raiz2 << endl; //
mostrar resulatdo
cout << "\t\t\tel resulatdo de la raiz cubica de 25 es :" << raiz3 << endl; //
mostrar resulatdo
cout << "\t\t\tel seno de 2pi/6 es:" << seno << endl;//mostrar mensaje
cout << "\t\t\tel resultado del operador logico 7>4 y 4<8 es 1verdadero,0falso :"
<< logico << endl;
return 0;// valor que restorna la funci�n
system("pause");//stop sobre consola
}// fin
===================================================================================
=======================================================
8. calcular el costo de produccion total semanal
/*comentario de bloque
calcular el costo total semanal de la produccion
codigo 2903894 sergio gutierrez
ing.industrial Grupo B*/
#include<iostream>//comentario directiva de procesador
using namespace std;//directiva de procesador
int main()//funcion principal
{//inicio
int costoproducir = 0;//definicion de variable tipo integer
float numerodeunidad = 0.0;//definicion de variable tipo float
cout << "\t\t\tinidicar numero de unidad";//mostrar mensaje
cin >> numerodeunidad;//leer datos
costoproducir = 285 + (2.5 * numerodeunidad);//hacer multiplicacion
cout << "\t\t\tel costo total de produccion precio en dolares:" << costoproducir <<
endl;//mostrar resultado
system("pause");//stop sobre consola
return 0;//valor que retorna la funcion
}//fin
===================================================================================
==============================================
9.calcular valor de metro cuadrado
/*comentario de bloque
calcular valor metro cuadrado
codigo 2903894 Sergio Gutierrez
Ing.Industrial Grupo B*/
#include<iostream>//comentario Directiva preprocesador
using namespace std; // Directiva preprocesador
int main()// funcion principal
{ // inicio
int A = 0 ;//definicion variables tipo integer
float total = 0.0 , area = 0.0 ;// definicion variable tipo float
cout << "\t\t\tIndicar A\n";//mostrar mensaje
cin >> A;// leer dato
area = (2*A) * A; // hacer multiplicacion
total= area * 2000; // hacer multiplicacion
cout << "\t\t\tEl resultado del precio total es: " << total<<endl; //mostrar
resultado
system("pause"); // Stop sobre consola
return 0; // valor que retorna la funcion
} // fin
===================================================================================
====================================================
10. calcular el area superficial de un cilindro
/*comentario de bloque
area cilindro
codigo 2903894 sergio gutierrez
ing.industrial Grupo B*/
#include<iostream>//comentario directiva de procesador
using namespace std;//directiva de procesador
int main()//funcion principal
{//inicio
int r = 0 , h = 0;//defnicion variable tipo integer
float area = 0, R= 0;//definicion de variable tipo float
cout << "\t\t\tindicar r\n";//mostrar mensaje
cout << "\t\t\tindicar h\n";//mostrar mensaje
cin >> r;//leer datos
cin >> h;//leer datos
R = r * r ; // hacer multiplicacion
area = 2*3.141592*r*h + 2*3.141592* R ; // hacer operaciones
cout << "\t\t\tEl resultado del area es " << area<<endl; //mostrar resultado
system("pause"); // Stop sobre consola
return 0; // valor que retorna la funcion
} // fin
===================================================================================
===================================================
11.saludar
/*saludar */
#include<iostream> //comentario directiva preprocesador
using namespace std; // directiva preprocesador
int main()//funcion principal
{// inicio
cout << "\t\t\t---------------------------------------------------------" << endl;
cout << "\t\t\t HOLA MUNDO MI NOMBRE ES SERGIO GUTIERREZ" << endl;
cout << "\t\t\t estudio ingenieria industrial, mi codigo es 2903894" << endl;
cout << "\t\t\t---------------------------------------------------------" << endl;
cout << endl << endl;
return 0;// valor que restorna la funci�n
system("pause");//stop sobre consola
}// fin