martes, 26 de noviembre de 2019

EJERCICIO WORD

ANTENA

JUEGO DE SOCCER

LISTA DE COMPRAS

MEGASTORES INFORMATICOS

AGENCIA DE VIAJES

ELECTRODOMESTICOS

Funcion De Calculadora

#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

void captura();
void suma();
void resta();
void multiplicacion();
void division();
void salir();
int n1,n2;
float su,res,mult, divi;
int main()
{
    system("Color 5F");
    cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
    cout << "My name is ale 7w7";
    cout << " Grupo 312";
    cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
    captura();
    suma();
    resta();
    multiplicacion();
    division();
    salir();
    return 0;
}

   void captura()
   {
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";

   cout << "**********Capture un numero:************";
   cin>>n1;

   cout<<"************Capture un segundo numero*****";
   cin>>n2;

cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
   }
   void suma()
   {
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
       su=n1+n2;
   cout<<"Los numeros sumados son  "<<n1<<" + "<<n2<<" = "<<su<<endl;
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
   }
   void resta()
   {
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
       res=n1-n2;
   cout<<"Los numeros restados son "<<n1<<" - "<<n2<<" = " <<res<<endl;
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
   }
   void multiplicacion()
   {
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
       mult=n1*n2;
   cout<<"Los numeros multiplicados son "<<n1<<" x "<<n2<<" = " <<mult<<endl;
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
   }
   void division()
   {
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
       divi=n1/n2;
   cout<<"Los numeros divididos son "<<n1<<" / "<<n2<<" = " <<divi<<endl;
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
   }
   void salir()
  {
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
      cout<<"Haz salido del programa"<<endl;
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
  }

Funcion

#include <stdio.h>
#include <iostream>
using namespace std;
void menu();
void captura();
void imprime();
int vec[10],j,k,op;
int main()

{
do
{

menu();
}
while(op!=3);
return 0;
}

void menu()
{
    cout<<"1.-Captura"<<endl;
    cout<<"2.-Imprime"<<endl;
    cout<<"3.-Salir"<<endl;
    cout<<"Elige una opcion"<<endl;
    cout<<"°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
    cin>>op;

switch(op)
{
case 1:captura();
   break;
   case 2:imprime();
   break;
   case 3:cout<<"Gracias por usar el sistema"<<endl;
   break;
   default:cout<<"Opcion erronea"<<endl; }
}
void captura()
{
cout<<"Funcion de captura"<<endl;
 for(j=0;j<=9;j++)
{
cout<<"Captura de numero"<<endl;
   cin>>vec[j];
}
  cout<<"Fin funcion captura"<<endl;
  cout<<"°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
  }
  void imprime()
  {
  cout<<"Funcion imprime"<<endl;
   for(j=0;j<=9;j++)
 {
 cout<<"El numero de la pocision"<<j<<"es"<<vec[j]<<endl;
 }
  cout<<"Fin funcion captura"<<endl;
  cout<<"°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°";
  }

jueves, 21 de noviembre de 2019

Examen de converciones

#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;
int opciones;
double  M,km,cm,mm,pies,B,kb,mb,gb,L,dm3,cm3,m3;
int main()
{      system("color 3F");
 cout<< "**************************************************************"  << endl;
      cout<< "MY NAME IS ALE 7w7"  << endl;
      cout<< "GRUPO 312"  << endl;
 cout<< "**************************************************************"  << endl;
       cout<< "Menu"  << endl;
       cout<<"1-Longuitud :3 "<< endl;
       cout<<"2-Informacion :v"<< endl;
       cout<<"3-Capacidad xD"<< endl;
       cout<<"4-salir :u"<< endl;
        cout<< "**************************************************************"  << endl;
       cin>>opciones;
 cout<< "**************************************************************"  << endl;
     switch(opciones)
     {
    case 1:
       cout<<"Ingrese una medida en metros"<<endl;
       cin>>M;
cout<< "**************************************************************"  << endl;
       km=M/1000;
       cout<<"Convercion de metros a kilometros"<<km<<endl;
       cm=M*100;
       cout<<"Convercion de metros a centrimetros"<<cm<<endl;
       mm=M*1000;
       cout<<"Convercion de metros a milimetros"<<mm<<endl;
       pies=M*3.28;
       cout<<"Convercion de metros a pies"<<pies<<endl;
       break;

    case 2:
       cout<<"Ingrese una medida en bytes"<< endl;
       cin>>B;
cout<< "**************************************************************"  << endl;
       kb=B/1024;
       cout<<"Convercion de bytes a kilobytes"<<kb<<endl;
       mb=B/1048576;
       cout<<"Convercion de bytes a megabytes"<<mb<<endl;
       gb=B/1073741824;
       cout<<"Convercion de bytes a gigabytes"<<gb<<endl;
       break;

    case 3:
       cout<<"Ingrese una medida en litros"<< endl;
       cin>>L;
cout<< "**************************************************************"  << endl;
       cm3=L*100;
       cout<<"Convercion de litros a centimetros(cm3)"<<cm3<<endl;
       dm3=L*1;
       cout<<"Convercion de litros a decimetros(dm3)"<<dm3<<endl;
       m3=L/100;
       cout<<"Convercion de litros a metros(m3)"<<m3<<endl;
       break;
    default:
       cout<<"Salir"<<endl;
       break;


}



return 0;
}

jueves, 14 de noviembre de 2019

Programa Evaluacion

Programa Evaluacion
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <time.h>

using namespace std;

void llenarvector();
void ordenado();
void imprime();

int vec1[20], vec2[20], num1=20, num2;
int n;
int main(){
 
 llenarvector();
 ordenado();
 imprime();
 
return 0;
}

void llenarvector(){

srand(time(NULL));
for(int i=0; i<=19; i++){
n=rand()/1000;
vec1[i]=n;
vec2[i]=vec1[i];

}
}

void ordenado(){
for(int i=0; i<num1; i++){
for(int j=0; j<num1-1; j++){
 if (vec2[j]>vec2[j+1]){
 num2=vec2[j];
 vec2[j]=vec2[j+1];
 vec2[j+1]=num2;
}
}
}

}

void imprime(){
 
cout <<"  IMPRESION DE NUMEROS RANDOM  "<<endl;
for (int i=0; i<=19; i++){
cout<<"\t"<< vec1[i] <<endl;
}
cout<<endl;
cout <<"  ORDENAMIENTO ASCENDENTE (BURBUJA)  "<<endl;
for(int i=0; i<=19; i++){
cout<<"\t"<< vec2[i] <<endl;
}

system("pause");

Programa 20 (Parte 2)

Programa 20 (Parte 2)
#include <stdio.h>
#include <iostream>
#include <windows.h>
using namespace std;

void gotoxy(int x,int y){
HANDLE hcon;
hcon=GetStdHandle(STD_OUTPUT_HANDLE);
COORD dwpos;
dwpos.X=x;
dwpos.Y=y;
SetConsoleCursorPosition(hcon, dwpos);
}
void completado();
void calcular();
void impresion();

float mat[5][5],x=5,y=8,n=0;

int main(){

completado();
calcular();
impresion();
}

void completado(){
for(int i=0; i<=3; i++){
for(int j=0; j<=3; j++){
gotoxy(x,y);
cin>>mat[i][j];
x+=5;
}
y+=2;
x=5;
}
}

void calcular(){
mat[0][4]=mat[0][0]+mat[0][1]+mat[0][2]+mat[0][3];
mat[0][4]=mat[0][4]/4;
mat[1][4]=mat[1][0]+mat[1][1]+mat[1][2]+mat[1][3];
mat[1][4]=mat[1][4]/4;
mat[2][4]=mat[2][0]+mat[2][1]+mat[2][2]+mat[2][3];
mat[2][4]=mat[2][4]/4;
mat[3][4]=mat[3][0]+mat[3][1]+mat[3][2]+mat[3][3];
mat[3][4]=mat[3][4]/4;
mat[4][0]=mat[0][0]+mat[1][0]+mat[2][0]+mat[3][0];
mat[4][0]=mat[4][0]/4;
mat[4][1]=mat[0][1]+mat[1][1]+mat[2][1]+mat[3][1];
mat[4][1]=mat[4][1]/4;
mat[4][2]=mat[0][2]+mat[1][2]+mat[2][2]+mat[3][2];
mat[4][2]=mat[4][2]/4;
mat[4][3]=mat[0][3]+mat[1][3]+mat[2][3]+mat[3][3];
mat[4][3]=mat[4][3]/4;
mat[4][4]=mat[0][4]+mat[1][4]+mat[2][4]+mat[3][4];
mat[4][4]=mat[4][4]/4;
system("pause");
system("cls");
}

void impresion(){
for(int i=0; i<=4; i++){
for(int j=0; j<=4; j++){
gotoxy(x,y);
cout<<mat[i][j];
x+=5;
}
y+=2;
x=5;
}
}

Programa 19 (Parte 2)

Programa 19 (Parte 2)

Programa 19 (Parte 2)
 #include <stdlib.h>
 #include <stdio.h>
 #include <iostream>
 #include <windows.h>

 using namespace std;

char cadena[30];
 int cliente,fac,pre1,pre2,pre3,total,iva;
 void captura();
 void operacion();
 void margen();
 void gotoxy(int x, int y)
 {
     HANDLE hcon;
    hcon=GetStdHandle(STD_OUTPUT_HANDLE);
    COORD dwPos;
    dwPos.X=x;
    dwPos.Y=y;
    SetConsoleCursorPosition(hcon,dwPos);
 }

 int main()

 {
    captura();
    operacion();
    margen();
   
     return 0;
 }

 void captura()

 {
     cout <<endl << endl<<"                         DISTRIBUIDORA ALEMAN                         "<<endl;
     cout <<endl<<endl<<"  CLIENTE:  ";
     gets(cadena);
     cout <<endl<<endl<<"  FACTURA:  " ;
     cin >> fac;
     cout << endl <<"  PRECIO 1:  ";
     cin >> pre1;
     cout << endl <<"  PRECIO 2:  ";
     cin >> pre2;
     cout << endl <<"  PRECIO 3:  ";
     cin >> pre3;
 }

 void operacion()

 {
  total=pre1+pre2+pre3;
  cout << endl << endl<<"  El Total es:  " << total << endl;
  
  iva= total*.16;
  cout << endl <<"  El IVA es:  " << iva << endl;
 }

 void margen ()

{

for(int x=1; x<=79; x++)

{
gotoxy (x,0);
putchar ('*');
gotoxy (x,24);
putchar ('*');
}

for(int y=1; y<=24; y++)

{
gotoxy (0,y);
putchar ('*');
gotoxy (79,y);
putchar ('*');
}
}

Programa 18 (Parte 2)

Programa 18 (Parte 2)

#include <iostream>
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>

using namespace std;
int n,m,A[3][4],x=5,y=0;

void captura();
void imprime();
void imprimetraspuesta();

void gotoxy (int x, int y)
{
    HANDLE hcon;
    hcon=GetStdHandle(STD_OUTPUT_HANDLE);
    COORD dwPos;
    dwPos.X=x;
    dwPos.Y=y;
    SetConsoleCursorPosition(hcon,dwPos);
}

int main()
{
 captura();
 imprime();
 imprimetraspuesta();

 return 0;
}
void captura(){
    for(int i=0; i<=2; i++){
        for(int j=0; j<=3; j++){
        gotoxy(y,x);
        cin >> A[i][j];
        x+=5;
    }
        y+=2;
        x=5;
    }
    system("pause");
    system("cls");
}

void imprime(){
  for(int i=0; i<=2; i++){
        for(int j=0; j<=3; j++){
        gotoxy(y,x);
        cout<< A[i][j];
        x+=5;
    }
        y+=2;
        x=5;
    }
     system("color 3");
    system("pause");
    system("cls");
    //system("Cls");

}

   void imprimetraspuesta(){
    for(int i=0; i<=2; i++){
     for(int j=0; j<=3; j++){
      gotoxy(x,y);
      cout<<A[i][j];
      x+=5;
     }
     y+=2;
     x=5;
    }

    system("pause");
    system("cls");

   }