jueves, 7 de noviembre de 2019

FIRMA 1(MODIFICADOS)

                                                       FIRMA 1
                                                                    (modificado)


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


using namespace std;

void imprimir();
void firma();
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 n,n1,n2,cont,j;
int main()

{
 imprimir();
 firma();
 return 0;

}
   void imprimir()

   {
 cout<<"funcion imprimir"<<endl;

    n1=0;
    n2=1;
    cout<<n1<<endl;
   cout<<n2<<endl;
 
    for(cont=1;cont<=11;cont=cont+1)
    {
        n=n1+n2;
        cout<<n<<endl;
       n1=n2;
        n2=n;
    }
  cout<<"fin funcion imprimir"<<endl;

}

void firma()
{

       for(j=1; j<=2; j++)
    {
        gotoxy(50,j);//Posiciona el curso en columna 15 y fila de 1 a 25
        system("color 4");//Cambia el color del texto
        cout<<"**Alethia Hermosillo**";
        //system("cls);//Borra la pantalla
    }
       for(j=1; j<=20; j++)
    {
       gotoxy(j,15); //Posiciona el curso en columna 15 y fila de 1 a 25
       system("color 4");
       cout<<"---------Elaborado por Alethia Hermosillo-----------";
       //system("cls");

    }
}


miércoles, 6 de noviembre de 2019

FIRMA(ALETHIA)

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

using namespace std;
int j;
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()
{

       for(j=1; j<=2; j++)
    {
        gotoxy(50,j);//Posiciona el curso en columna 15 y fila de 1 a 25
        system("color 4");//Cambia el color del texto
        cout<<"**Alethia Hermosillo**";
        //system("cls);//Borra la pantalla
    }
       for(j=1; j<=20; j++)
    {
       gotoxy(j,15); //Posiciona el curso en columna 15 y fila de 1 a 25
       system("color 4");
       cout<<"---------Elaborado por Alethia Hermosillo-----------";
       //system("cls");

    }
    return 0;
}





viernes, 25 de octubre de 2019

EVALUACION

                                                                             EXAMEN 



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

using namespace std;
void llenarvector();
void ordenador();
void imprimirvector();


int vec1[20], vec2[20], num1=20, num2;
int n;
int main(){

   llenarvector();
   ordenador();
   imprimirvector();

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 ordenador()
{

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 imprimirvector()
  {

cout <<"  *-*-*-*-*-*-*-*IMPRESION DE NUMEROS RANDOM *-*-*-*-*-*-*-* "<<endl;
for (int i=0; i<=19; i++){
cout<<"\t"<<"\t"<<  vec1[i] <<endl;
}

cout<<endl;
cout <<"  *-*-*-*ORDENAMIENTO DE MENOR A MAYOR CON METODO BURBUJA*-*-*-* "<<endl;
for(int i=0; i<=19; i++){
cout<<"\t"<<"\t"<< vec2[i] <<endl;
}
system("pause");

}




CÓDIGO 20

                                                         PROGRAMA 20
                                                                                  (matrices)


#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 imprimir();

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

int main(){

completado();
calcular();
imprimir();
}

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");
system("color F3");
}

void imprimir(){
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;
}

}




martes, 22 de octubre de 2019

FACTURA

                                                              PROGRAMA 19
                                                                                       (factura)

 #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
using namespace std;
char cadena[30];
void captura();
void imprimir();
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 fac,p1,p2,p3,suma,total,x,y;
int main()
{
captura();
imprimir();
margen();
return 0;
}
void captura()
{
cout<<endl<<endl<<"-----------------DISTRIBUIDORA----------------"<<endl;
cout<<endl<<endl<<"----------------------ALEMAN----------------------"<<endl;
cout<<endl<<endl<<"   CLIENTE:   ";
 gets(cadena);
 cout<<endl<<endl<<"   FACTURA:   ";
 cin>>fac;
cout<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<" "<<"PRECIO"<<endl;
 cout<<endl<<"  PRODUCTO 1:  ";
 cin>>p1;
 cout<<endl<<"  PRODUCTO 2:  ";
 cin>>p2;
 cout<<endl<<"  PRODUCTO 3:  ";
 cin>>p3;
}
void imprimir()
 {
 suma=p1+p2+p3;
 total=suma*0.16;
 cout<<endl<<endl<<"  Total:  "<<suma<<endl;
 cout<<endl<<"  IVA:  "<<total<<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('/');
}

}     



                  

viernes, 18 de octubre de 2019

CÓDIGO 18...

                                                               PROGRAMA 18
                                                                                          (matrices)


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

using namespace std;
int j,i,mat[4][4],x=5,y=8;
void captura();
void imprime();
void imprimerespuesta();
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();
       system("PAUSE");
       system("CLS");
       imprime();
       system("PAUSE");
       imprimerespuesta();
       system("PAUSE");


       return 0;
}

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


      void imprime()
{

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


}
     system("color 3");
    //system("cls");

}

     void imprimerespuesta()
{

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


}
system("color 3");
}





jueves, 17 de octubre de 2019

CÓDIGO 17.

                                                                 PROGRAMA 17
                                                                                            (matrices)


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

using namespace std;
int mat[4][4],f,c,x=5,y=8;
void captura();
void imprime ();
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 captura();
void imprime();

int main()

{
    captura ();
    system("PAUSE");
    system("CLS");

    imprime();

    return 0;
}
    void captura ()
{
     for(f=0;f<=3;f++)
     for(c=0;c<=3;c++)
{

     cout<<"captura un numero"<<endl;
     cin>>mat[f][c];
  }

}

    void imprime ()
    {
         for(int f=0; f<=3; f++){
        for(int c=0; c<=3; c++){
        gotoxy(x,y);
        cout<<mat[f][c];
        x+=5;
}
        y+=2;
        x=5;
}
    system("color 4");
    //system("cls");

}