viernes, 16 de noviembre de 2018

Caratula


UNIVERSIDAD MARIANO GÁLVEZ DE GUATEMALA
CENTRO REGIONAL MALACATÁN
FACULTAD DE INGENIERIA
Resultado de imagen para UNIVERSIDAD MARIANO GALVEZ WALLPAPER


Ingeniería en Sistemas

Estudiante:                                                                                   
                                 Jorge Alberto Maldonado
Catedratico: 
                ING. Carlos Godinez Guzman

Carnet:
               6690 -18-19056
Curso:

            algoritmos



INTRODUCCION

C++ es un lenguaje de programación creado por Bjarne Stroustrup en los laboratorios de At&T en 1983. Stroustrup tomó como base un lenguaje de programación popular en aquella época el cual era C.
El C++ es un derivado del mítico lenguaje C, el cual fue creado en la década de los 70 por la mano del finado Dennis Ritchie para la programación del sistema operativo Unix [1] (un sistema parecido a Unix es GNU/Linux), el cual surgió como un lenguaje orientado a la programación de sistemas (System Programming) y de herramientas (Utilities) recomendado sobre todo para programadores expertos, y que no llevaba implementadas muchas funciones [¿cómo cuáles?] que hacen a un lenguaje más comprensible
PROGRAMAS CON IF ELSE

PROGRAMA PARA VOTAR


PROGRAMA PARA VOTAR
#includ <conio.h>
#include <stdio.h>

                int main()
{
                int edad;
                printf ("\n Escriba su edad") ;
                scanf ("%d", &edad) ;
                               if(edad<18)
                               {
                                               printf ("\n Eres menor de edad aun no puedes votar");
                               }
                               
                                               else
                               
                                {
                                               if(edad>=18)
                                               printf ("\n Eres mayor de edad");
                                               printf ("\n ya puedes votar =D");
                                }
                               
                               
                               return 0;
                              
}

PROGRAMA PARA HALLAR AREA Y PERIMETRO DE UN ROMBO


PROGRAMA PARA HALLAR AREA Y PERIMETRO DE UN ROMBO
#include <conio.h>
#include <stdio.h>
#include <math.h>



int main ()
{
                int a,d,d1;
                float area,per;
                               printf ("\n Rombo:");
                               printf ("\n Introduzca lado:");
                               scanf ("%d",a);
                               printf ("\n Introduzca diagonal menor:");
                               scanf ("%d",d);
                               printf ("\n Introduzca diagonal mayor:");
                               scanf ("%d",d1);
                              
                               per = pow(a,4);
                               printf ("\n EL PERIMETRO DEL ROMBO ES: %.2f", per) ;
                              
                               area = d1*d/2;
                               printf ("\n EL AREA DEL ROMBO ES: %.2f", area) ;
                return 0;
}

PROGRAMA PARA VER LA CALIDAD DE ESTUDIANTES
# h>
int main ()
{
                int cal;

                printf ("\n Dame calificacion:");
                scanf ("%d", &cal);
               
                if (cal<60)
                               printf ("\n Usted es un mal alumno");
                if (cal>60 & cal<=70)
                               printf ("\n Usted es un alumno regular");
                if (cal>70 & cal<=85)
                               printf ("\n Usted es un buen alumno");
                if             (cal>85 & cal<=100)
                               printf ("\n Usted es un excelente alumno");
               
                return 0;
}

PROGRAMA PARA AUMENTO DE DE SALARIO


PROGRAMA PARA AUMENTO DE DE SALARIO
#include <stdio.h>
#include <conio.h>
#include <math.h>
int main ()
{
                int op, sueldo, cont=2000, pla=2100, secre=1800, jor=1500, admon=3000;
                float aum;
                printf("\n AREA DE TRABAJO");
                printf("\n 1- CONTADOR");
                printf("\n 2- PLANILLERO");
                printf("\n 3- SECRETARIA");
                printf("\n 4- JORNALERO");
                printf("\n 5- ADMINISTRACION");
                printf("\n Ingrese su opcion:");
                scanf("%d", &op);
               
                if (op==1)
                {
                               printf ("\n su sueldo es de:%d",cont);
                               sueldo = cont+160;
                               printf ("\n su sueldo con aumento es de:%d",sueldo);
                               aum = (2160-2000);
                               printf ("\n Su aumento fue de:%2.f",aum);
                }
                               if (op==2)
                {
                               printf ("\n su sueldo es de:%d",pla);
                               sueldo = pla+210;
                               printf ("\n su sueldo con aumento es de:%d",sueldo);
                               aum = (2310-2100);
                               printf ("\n Su aumento fue de:%2.f",aum);
                }
                               if (op==3)
                {
                               printf ("\n su sueldo es de:%d",secre);
                               sueldo = secre+198;
                               printf ("\n su sueldo con aumento es de:%d",sueldo);
                               aum = (1998-1800);
                               printf ("\n Su aumento fue de:%2.f",aum);
                }
                               if (op==4)
                {
                               printf ("\n su sueldo es de:%d",jor);
                               sueldo = jor+126;
                               printf ("\n su sueldo con aumento es de:%d",sueldo);
                               aum = (1626-1500);
                               printf ("\n Su aumento fue de:%2.f",aum);
                }
                               if (op==5)
                {
                               printf ("\n su sueldo es de:%d",admon);
                               sueldo = admon+180;
                               printf ("\n su sueldo con aumento es de:%d",sueldo);
                               aum = (3180-3000);
                               printf ("\n Su aumento fue de:%2.f",aum);
                }
               
               
               
                return 0;
}

FUNCION MATEMATICA


PROGRMA PARA RESOLVER OPERCIONES MATEMATICAS BASICA


#include <stdio.h>
#include <math.h>

int main ()
{
                float div;
               
                printf("\n ELIJA OPCION");
                printf("\n 1 - +");
                printf("\n 2 - -");
                printf("\n 3 - *");
                int n1, n2, su, res, mult, op;

                printf("\n 4 - /");
               
                printf("\n INGRESE SU OPCION: ");
                scanf("%d", &op);
               
                if (op==1)
                {
                               printf ("\n SUMA");
                               printf ("\n INGRESE PRIMER NUMERO: ");
                               scanf ("%d", & n1);
                               printf ("\n INGRESE SEGUNDO NUMERO: ");
                               scanf ("%d", &n2);
                               su=n1+n2;
                    printf ("\n LA SUMA ES:%d", su);
                }
               
                               if (op==2)
                {
                               printf ("\n RESTA");
                               printf ("\n INGRESE PRIMER NUMERO: ");
                               scanf ("%d", & n1);
                               printf ("\n INGRESE SEGUNDO NUMERO: ");
                               scanf ("%d", &n2);
                               res=n1-n2;
                    printf ("\n LA RESTA ES:%d", res);
                }
               
                if (op==3)
                {
                               printf ("\n MULTIPLICACION");
                               printf ("\n INGRESE PRIMER NUMERO: ");
                               scanf ("%d", & n1);
                               printf ("\n INGRESE SEGUNDO NUMERO: ");
                               scanf ("%d", &n2);
                               mult=n1*n2;
                    printf ("\n LA MULTIPLICACION ES:%d", mult);
                }
                if (op==4)
                {
                               printf ("\n DIVISION");
                               printf ("\n INGRESE PRIMER NUMERO: ");
                               scanf ("%d", & n1);
                               printf ("\n INGRESE SEGUNDO NUMERO: ");
                               scanf ("%d", &n2);
                               div=n1/n2;
                    printf ("\n LA DIVISION ES:%2.f", div);
                }
               
}

PROGRAMA CON MENU DE FUNCIONES


PROGRAMA CON MENU DE FUNCIONES
#include <conio.h>
#include <stdio.h>
#include <math.h>
int main ()
{
                int a,op,b,c,quin,su,pro,suma, a1=50, b2=75, c3=25 ;
                float arro, lib, res, dif, cua, cub;
               
                printf("\n MENU PRINCIPAL");
                printf("\n 1-SUMA");
                printf("\n 2-MAIZ");
                printf("\n 3-FUNCION");
                printf("\n Ingrese su opcion:");
                scanf("%d", &op);
               
                if (op==1)
                {
                               printf ("\n SUMA");
                               printf ("\n INGRESE VALOR DE A:");
                               scanf ("%d",&a);
                               printf ("\n INGRESE VALOR DE B:");
                               scanf ("%d",&b);
                               printf ("\n INGRESE VALOR DE C:");
                               scanf ("%d",&c);
                              
                               su= pow(a+b,2);
                               printf ("\n LA SUMA DE A Y B ES:%d", su);
                               pro=pow(b+c,3);
                               printf ("\n EL PRODUCTO DE B Y C ES:%d", pro);
                               suma=su+pro;
                               printf ("\n LA SUMA DE A Y B + EL PRODUCTO DE B Y C ES:%d", suma);
                               dif=pro-suma;
                               printf ("\n LA DIFERENCIA ENTRE EL CUBO Y EL CUADRADO ES DE:%2.f", dif);
                }
               
                if (op==2)
                {
                               printf ("\n Maiz");
                               printf ("\n INGRESE CANTIDAD DE QUINTALES COMPRADOS:");
                               scanf ("%d", &quin);
                              
                               arro = quin*4;
                               lib =quin*100;
                               printf ("\n LA CANTIDAD EN ARROBAS ES:%2.f", arro);
                               printf ("\n LA CANTIDAD EN LIBRAS ES: %2.f", lib);
                }
                if  (op==3)
                {
                               printf ("\n FUNCION");
                               printf ("\n LA SUMA DE A+B+C ");
                               suma = a1+b2+c3;
                               cua= pow(a1+b2+c3, 2);
                               cub= pow (a1+b2+c3, 3);
                               printf ("\n LA SUMA ES:%d", suma);
                               printf ("\n EL RESULTADO ELEVADO AL CUADRADO ES:%2.f", cua);
                               printf ("\n EL RESULTADO ELEVADO AL CUBO ES:%2.f", cub);
                }
                return 0;
}

PROGRAMA DE CONVERSION


PROGRAMA DE CONVERSION

#include <conio.h>
#include <math.h>
#include <stdio.h>

int main ()
{
                int op;
                float quet,pes,eur, dol, total;
                printf("\n MENU PRINCIPAL DE CONVERSION");
                printf("\n 1- QUETZALES A DOLARES");
                printf("\n 2-CONVERTIR QUETZALES A PESOS");
                printf("\n 3- CONVERTIR QUETZALES A EUROS");
                printf("\n Ingrese su opcion:");
                scanf("%d", &op);         
               
               
                if (op==1)
                               {
                               printf ("\n CONVERTIR QUETZALES A PESOS");
                               printf ("\n INGRESE CIFRAS EN QUETZALES:");
                               scanf ("%f", &quet);
                               printf ("\n INGRESE EL CAMBIO ACTUAL:");
                               scanf ("%f", &dol);
                               total = quet*dol;
                               printf("\n LA CANTIDAD EN DOLARES ES: %.3f", total);
                }
               
                if (op==2)
                               {
                               printf ("\n CONVERTIR QUETZALES A PESOS");
                               printf ("\n INGRESE CIFRAS EN QUETZALES:");
                               scanf ("%f", &quet);
                               printf ("\n INGRESE EL CAMBIO ACTUAL:");
                               scanf ("%f", &pes);
                               total = quet*pes;
                               printf("\n LA CANTIDAD EN PESOS MEXICANOS ES: %.3f", total);
                }
               
                if (op==3)
                               {
                               printf ("\n CONVERTIR QUETZALES A PESOS");
                               printf ("\n INGRESE CIFRAS EN QUETZALES:");
                               scanf ("%f", &quet);
                               printf ("\n INGRESE EL CAMBIO ACTUAL");
                               scanf ("%f", & eur);
                               total = quet*eur;
                               printf("\n LA CANTIDAD EN EUROS ES: %.3f", total);
                }
                return 0;
}

IMPUESTOS


IMPUESTOS

#include <conio.h>
#include <math.h>
#include <stdio.h>

int main ()
{
                int imp=1500,led=1800,ca=3000;
                float total, total1,total2, total3,res,res1,res2;
               
                printf ("\n Compra de impresora");
                total=imp*0.15;
                res=imp-total;
                printf ("\n El precio de la impresora es:%2.f", res);
               
                printf ("\n Compra de pantalla led");
                total1=led*0.25;
                res1=led-total1;
                printf ("\n El precio de la pantalla led es:%2.f", res1);
               
                printf ("\n Compra de cañonera");
                total2=ca*0.07;
                res2=ca-total2;
                printf ("\n El precio de la cañonera  es:%2.f", res2);
               
               
                total3=res+res1+res2;
                printf ("\n El total a pagar es:%2.f", total3);
return 0;
               
}

PROGRAMA GEOMETRICO PARA HALLAR AREAS Y PERIMETROS
#include <conio.h>
#include <stdio.h>
#include <math.h>

#define PI 3.141516

int main ()
{
                int a1,a,l,m,n,b,b1,h,d1,d,B,o,s,s1,op;
                float area, r, per;
               
                printf("\n AREAS Y PERIMETROS");
                printf("\n 1- CIRCULO");
                printf("\n 2- RECTANGULO");
                printf("\n 3- TRIANGULO");
                printf("\n 4- CUADRADO");
                printf("\n 5- PENTAGONO");
                printf("\n 6- ROMBO");
                printf("\n 7- ROMBOIDE");
                printf("\n 8- TRAPECIO");
                printf("\n 9- HEXAGONO");
                printf("\n 10- ECLIPSE");
                printf("\n 11- POLIGONO IRREGULAR");
                printf("\n Ingrese su opcion:");
                scanf("%d", & op);
               
                if (op==1)
                {
               
                               printf ("\n CIRCULO:");
                               printf ("\n Introduzca Diametro:");
                               scanf ("%d", &d);
                               printf ("\n Introduzca Radio:") ;
                               scanf ("%f", &r);
               
                               per = d * PI;
                               printf ("\n EL PERIMETRO DEL CIRCULO ES: %.2f", per) ;
               
                               area = PI * pow(r, 2);
                               printf ("\n EL AREA DEL CIRCULO  ES: %.2f", area) ;
                }
               
                               if (op==2)
                {
               
                               printf ("\n RECTANGULO:");
                               printf ("\n Introduzca base:");
                               scanf ("%d", &b);
                               printf ("\n Introduzca Altura:");
                               scanf ("%d", &h);
               
                               per = b*h;
                               printf ("\n EL PERIMETRO DEL RECTANGULO ES: %.2f", per) ;
                              
                               area = pow(b,2) + pow(h,2);
                               printf ("\n EL AREA DEL RECTANGULO  ES: %.2f", area) ;
                }
               
                if (op==3)
                {
               
                               printf ("\n TRIANGULO:");
                               printf ("\n INGRESE LADO 1:");
                               scanf ("%d", &l);
                               printf ("\n INGRESE LADO 2:");
                               scanf ("%d", &m);
                               printf ("\n INGRESE LADO 3:");
                               scanf ("%d", &n);
                              
                               printf ("\n Introduzca base:");
                               scanf ("%d",&b);
                               printf ("\n Introduzca Altura:");
                               scanf ("%d",&h);
                              
                               per = l+m+n;
                               printf ("\n EL PERIMETRO DEL TRIANGULO ES: %.2f", per) ;
                              
                               area = b*h/2;
                               printf ("\n EL AREA DEL TRIANGULO ES: %.2f", area) ;
                }
                               if (op==4)
                {
               
                               printf ("\n CUADRADO:");
                               printf ("\n INGRESE LADO:");
                               scanf ("%d", &a);
                              
                               per = pow(a,2);
                               printf ("\n EL PERIMETRO DEL CUADRADO ES: %.2f", per) ;
                              
                               area = pow(a,4);
                               printf ("\n EL AREA DEL CUADRADO  ES: %.2f", area) ;
                }
               
                               if (op==5)
                {
               
                               printf ("\n PENTAGONO:");
                               printf ("\n Introduzca base:");
                               scanf ("%d", &b);
                               printf ("\n Introduzca apotema:");
                               scanf ("%d", &a1);
                              
                              
                               per = pow(b,5);
                               printf ("\n EL PERIMETRO DEL PENTAGONO ES: %.2f", per) ;
                              
                               area = per*a1/2;
                               printf ("\n EL AREA DEL PENTAGONO  ES: %.2f", area) ;
                }
               
                if (op==6)
                {
               
                               printf ("\n Rombo:");
                               printf ("\n Introduzca lado:");
                               scanf ("%d", &a);
                               printf ("\n Introduzca diagonal menor:");
                               scanf ("%d", &d);
                               printf ("\n Introduzca diagonal mayor:");
                               scanf ("%d", &d1);
                              
                               per = pow(a,4);
                               printf ("\n EL PERIMETRO DEL ROMBO ES: %.2f", per) ;
                              
                               area = d1*d/2;
                               printf ("\n EL AREA DEL ROMBO ES: %.2f", area) ;
                }
               
                               if (op==7)
                {
               
                               printf ("\n ROMBOIDE:");
                               printf ("\n Introduzca base:");
                               scanf ("%d", &b);
                               printf ("\n Introduzca Altura:");
                               scanf ("%d", &h);
               
                               per = b*h;
                               printf ("\n EL PERIMETRO DEL ROMBOIDE ES: %.2f", per) ;
                              
                               area = pow(b,2) + pow(h,2);
                               printf ("\n EL AREA DEL ROMBOIDE  ES: %.2f", area) ;
                }
                if (op==8)
                {
               
                               printf ("\n TRAPECIO");
                               printf ("\n Introduzca lado 1:");
                               scanf ("%d", &l);
                               printf ("\n Introduzca lado 2:");
                               scanf ("%d", &m);
                               printf ("\n Introduzca lado 3:");
                               scanf ("%d", &n);
                               printf ("\n Introduzca lado 4:");
                               scanf ("%d", &o);
                               printf ("\n Introduzca base  menor:");
                               scanf ("%d", &b);
                               printf ("\n Introduzca base mayor:");
                               scanf ("%d", &b1);
                               printf ("\n Introduzca altura:");
                               scanf ("%d", &h);
                              
                               per = l+m+n+o;
                               printf ("\n EL PERIMETRO DEL TRAPECIO ES: %.2f", per) ;
                              
                               area =h*b1+b/2 ;
                               printf ("\n EL AREA DEL TRAPECIO ES: %.2f", area) ;
                }
                               if (op==9)
                {
               
                               printf ("\n HEXAGONO:");
                               printf ("\n Introduzca base:");
                               scanf ("%d", &b);
                               printf ("\n Introduzca apotema:");
                               scanf ("%d", &a1);
                              
                              
                               per = pow(b,6);
                               printf ("\n EL PERIMETRO DEL HEXAGONO ES: %.2f", per) ;
                              
                               area = per*a1/2;
                               printf ("\n EL AREA DEL HEXAGONO  ES: %.2f", area) ;
                }             
                if (op==10)
                {
               
                               printf ("\n ECLIPSE:");
                               printf ("\n Introduzca Semieje Menor:");
                               scanf ("%d", &s);
                               printf ("\n Introduzca semieje Mayor:") ;
                               scanf ("%f", &s1);
               
                               per = 0;
                               printf ("\n NO SE PUEDE CALCULAR PERIMETRO: %.2f", per) ;
               
                               area = PI *s1*s ;
                               printf ("\n EL AREA DEL ECLIPSE  ES: %.2f", area) ;
                }
                if (op==11)
                {
               
                               printf ("\n TRAPECIO");
                               printf ("\n Introduzca lado 1:");
                               scanf ("%d", &l);
                               printf ("\n Introduzca lado 2:");
                                scanf ("%d", &m);
                               printf ("\n Introduzca lado 3:");
                               scanf ("%d", &n);
                               printf ("\n Introduzca lado 4:");
                               scanf ("%d", &o);
                              
                              
                               per = l+m+n+o;
                               printf ("\n EL PERIMETRO DEL TRAPECIO ES: %.2f", per) ;
                              
                               area =0;
                               printf ("\n NO SE PUEDE CALCULAR AREA: %.2f", area) ;
                }             
                              
                return 0;
}