jueves, 21 de noviembre de 2019

Examen

#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
using namespace std;
float m,km,cm,mm,p,bt,kb,mb,gb,lts,cm3,dm3,m3;

int opc ;
int main()
{
cout<<"--------------------------------------------------------------------------------------------------"<<endl;
    cout<<"     *Menu de opciones*\n"<<endl;
    cout<<" 1.Conversion de metros"<<endl;
    cout<<" 2.Conversion de bytes"<<endl;
    cout<<" 3.Conversion de Litros"<<endl;
    cout<<" Elige una opcion: ";
    cin>>opc;
    switch(opc)
    {
    case 1:
        cout<<"\n     *Conversion de Metros*\n"<<endl;
        cout<<" Ingresa la medida en metros"<<endl;
        cin>>m;
        km=m/1000;
        cm=m*100;
        mm=m*1000;
        p=m*3.28;
        cout<<" En kilometros es: "<<km<<endl;
        cout<<" En centimetros es: "<<cm<<endl;
        cout<<" En milimetros es: "<<mm<<endl;
        cout<<" En pies es: "<<p<<endl;
        break;
    case 2:
        cout<<"\n     *Conversion de Bytes*\n"<<endl;
        cout<<" Ingresa la medida del byte"<<endl;
        cin>>bt;
        kb=bt/1024;
        mb=bt/1048576;
        gb=bt/1073741824;
        cout<<" En Kilobytes es: "<<kb<<endl;
        cout<<" En Megabytes es: "<<mb<<endl;
        cout<<" En Gigabytes es: "<<gb<<endl;
        break;
    case 3:
        cout<<"\n    *Conversion de Litros*\n"<<endl;
        cout<<" Ingresa los Litros"<<endl;
        cin>>lts;
        cm3=lts*100;
        dm3=lts*1;
        m3=lts/100;
        cout<<" En cm3 es: "<<cm3<<endl;
        cout<<" En dm3 es: "<<dm3<<endl;
        cout<<" En m3 es: "<<m3<<endl;
        break;
        default:"opcion no valida";
        break;
     
    }
    cout<<"--------------------------------------------------------------------------------------------------"<<endl;
    return 0;

}

jueves, 14 de noviembre de 2019

trabajo 87

gustavo 312 by b00uv on Scribd

Trabajo 86

Trabajo 85

434070133-Ejercicio-85 by b00uv on Scribd

Trabajo 84

434069918-Ejercicio-84 by b00uv on Scribd

Trabajo 83

83 by b00uv on Scribd

Trabajo 82

82 by b00uv on Scribd

Trabajo 81

81 by b00uv on Scribd

Trabajo 80

L80 by b00uv on Scribd

jueves, 7 de noviembre de 2019

Programa 12 modificado con firma

#include <iostream>

#include <stdio.h>

using namespace std;

int vec[20],i,j,num;

void captura();

void impresion();

int main()

{

cout << "CAPTURA 20 DATOS EN UN VECTOR SI SON MAYORES A 35" << endl;



    for (i=0; i<=19; i++)

    {

        cout << "INGRESA EL DATO" << endl;

        cin >> num;



       if (num>35)

            vec[i]=num;

    }

    for (j=0; j<=19; j++)

    {

        cout << vec[j] <<endl;

    }







  cout<<"                           __                             "<<endl;

 cout<<"                         .'  '.                           "<<endl;

 cout<<"                    _.-'/  |  \                           "<<endl;

 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;

 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;

 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;

 cout<<"          \            .'     |                         | "<<endl;

 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;

 cout<<"        _/   _.'(             |           A SUS         | "<<endl;

 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;

 cout<<"      \  \    `-'             |                         | "<<endl;

 cout<<"        `-'                   '-------------------------' "<<endl;






}

Programa 11 modificado con firma

#include <iostream>

#include <stdio.h>

using namespace std;

int vec[15],h,j;

void captura();

void impresion();

int main()

{

cout << "CAPTURA 15 DATOS EN UN VECTOR" << endl;



    for (h=14; h>=0; h--)

    {

        cout << "INGRESA EL DATO" << endl;

        cin >> vec[h];

    }

    for (j=14; j>=0; j--)

    {

        cout << vec[j] <<endl;

    }




  cout<<"                           __                             "<<endl;

 cout<<"                         .'  '.                           "<<endl;

 cout<<"                    _.-'/  |  \                           "<<endl;

 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;

 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;

 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;

 cout<<"          \            .'     |                         | "<<endl;

 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;

 cout<<"        _/   _.'(             |           A SUS         | "<<endl;

 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;

 cout<<"      \  \    `-'             |                         | "<<endl;

 cout<<"        `-'                   '-------------------------' "<<endl;






}

Programa 10 modificado con formula

#include <iostream>

#include <stdio.h>

using namespace std;

int vec[20],i,j;


void captura();

void impresion();

int main()

{

cout << "CAPTURA 20 DATOS EN UN VECTOR" << endl;



    for (i=0; i<=19; i++)

    {

        cout << "INGRESA EL DATO" << endl;

        cin >> vec[i];

    }

    for (j=0; j<=19; j++)

    {

        cout << vec[j] <<endl;

    }



  cout<<"                           __                             "<<endl;

 cout<<"                         .'  '.                           "<<endl;

 cout<<"                    _.-'/  |  \                           "<<endl;

 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;

 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;

 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;

 cout<<"          \            .'     |                         | "<<endl;

 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;

 cout<<"        _/   _.'(             |           A SUS         | "<<endl;

 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;

 cout<<"      \  \    `-'             |                         | "<<endl;

 cout<<"        `-'                   '-------------------------' "<<endl;




   return 0;

}

Programa 9 modificado con firma

#include <iostream>

#include <stdio.h>

using namespace std;

int vec[10],h,j,multiplo;


void captura();

void impresion();

int main()

{

cout << "MULTIPLOS DE 8" << endl;



    for (h=0; h<=9; h++)

    {

        multiplo= (h+1)*8;

        vec[h]=multiplo;

    }

    for (j=0; j<=9; j++)

    {

        cout << vec[j] <<endl;

    }

  cout<<"                           __                             "<<endl;

 cout<<"                         .'  '.                           "<<endl;

 cout<<"                    _.-'/  |  \                           "<<endl;

 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;

 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;

 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;

 cout<<"          \            .'     |                         | "<<endl;

 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;

 cout<<"        _/   _.'(             |           A SUS         | "<<endl;

 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;

 cout<<"      \  \    `-'             |                         | "<<endl;

 cout<<"        `-'                   '-------------------------' "<<endl;




   return 0;

}


Programa 8 modificado con firma

#include <iostream>

#include <stdio.h>



using namespace std;

float arti,ct,iva,tp;

int i;


void captura();

void impresion();

int main()

{

    for(i=1;i<=5;i++)

    {

        cout <<"INGRESA EL ARTICULO"<<endl;

        cin>>arti;

        ct=ct+arti;

    }

    cout <<"LA COMPRA TOTAL ES "<<ct<<endl;

    iva=ct*0.016;

    cout <<"EL IVA TOTAL ES "<<iva<<endl;

    tp=ct+iva;

    cout <<"EL TOTAL A PAGAR ES "<<tp<<endl;

  cout<<"                           __                             "<<endl;

 cout<<"                         .'  '.                           "<<endl;

 cout<<"                    _.-'/  |  \                           "<<endl;

 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;

 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;

 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;

 cout<<"          \            .'     |                         | "<<endl;

 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;

 cout<<"        _/   _.'(             |           A SUS         | "<<endl;

 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;

 cout<<"      \  \    `-'             |                         | "<<endl;

 cout<<"        `-'                   '-------------------------' "<<endl;




   return 0;

}

Programa 7 modificado con firma

#include <iostream>

#include <stdio.h>



using namespace std;

float prom,calif,acum;

int j;


void captura();

void impresion();

int main()

{

    cout << "PROMEDIO DE 20 CALIFICACIONES"<< endl;

    for(j=1;j<=20;j++)

    {

        cout <<"INGRESA LA CALIICACION"<<endl;

        cin>>calif;

        acum=acum+calif;

    }

    prom=acum/20;

    cout <<"EL PROMEDIO ES "<<prom<<endl;
  cout<<"                           __                             "<<endl;

 cout<<"                         .'  '.                           "<<endl;

 cout<<"                    _.-'/  |  \                           "<<endl;

 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;

 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;

 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;

 cout<<"          \            .'     |                         | "<<endl;

 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;

 cout<<"        _/   _.'(             |           A SUS         | "<<endl;

 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;

 cout<<"      \  \    `-'             |                         | "<<endl;

 cout<<"        `-'                   '-------------------------' "<<endl;




   return 0;

}

Programa 6 modificado con firma

#include <iostream>

#include <stdio.h>

using namespace std;

int n1,n2,n3,suma;


void captura();

void impresion();



int main()

{

    cin >>n1;

    cin >>n2;

    cin >>n3;



    suma= n1+n2+n3;

    cout << suma << endl;
  cout<<"                           __                             "<<endl;

 cout<<"                         .'  '.                           "<<endl;

 cout<<"                    _.-'/  |  \                           "<<endl;

 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;

 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;

 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;

 cout<<"          \            .'     |                         | "<<endl;

 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;

 cout<<"        _/   _.'(             |           A SUS         | "<<endl;

 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;

 cout<<"      \  \    `-'             |                         | "<<endl;

 cout<<"        `-'                   '-------------------------' "<<endl;




   return 0;

}

Programa 5 modificado con firma

#include <iostream>

#include <stdio.h>



using namespace std;

int i,multiplo;

void captura();

void impresion();

int main()

{

    cout << "TABLA DE MULTIPLICAR DEL 6"<< endl;

    for(i=1;i<=15;i++)

    {

        multiplo=i*6;

        cout <<"6x"<<i<<"="<<multiplo<<endl;

    }
  cout<<"                           __                             "<<endl;

 cout<<"                         .'  '.                           "<<endl;

 cout<<"                    _.-'/  |  \                           "<<endl;

 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;

 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;

 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;

 cout<<"          \            .'     |                         | "<<endl;

 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;

 cout<<"        _/   _.'(             |           A SUS         | "<<endl;

 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;

 cout<<"      \  \    `-'             |                         | "<<endl;

 cout<<"        `-'                   '-------------------------' "<<endl;




   return 0;

}

Programa 4 modificado con firma

#include <iostream>

#include<stdio.h>



using namespace std;

int h;

void captura();

void impresion();

int main()

{

   cout<<"Multiplo de 8"<<endl;

  for(h=8;h<=160;h=h+8)

  {

     cout<<h<<endl;

  }
  cout<<"                           __                             "<<endl;

 cout<<"                         .'  '.                           "<<endl;

 cout<<"                    _.-'/  |  \                           "<<endl;

 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;

 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;

 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;

 cout<<"          \            .'     |                         | "<<endl;

 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;

 cout<<"        _/   _.'(             |           A SUS         | "<<endl;

 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;

 cout<<"      \  \    `-'             |                         | "<<endl;

 cout<<"        `-'                   '-------------------------' "<<endl;




   return 0;

}

Programa 3 modificado con firma

#include <iostream>

#include<stdio.h>



using namespace std;

int h;

void captura();

void impresion();

int main()

{

    cout<<"Multiplo de 3"<<endl;

   for(h=3;h<=66;h=h+3)

   {

      cout<<h<<endl;

   }








 cout<<"                           __                             "<<endl;
 cout<<"                         .'  '.                           "<<endl;
 cout<<"                    _.-'/  |  \                           "<<endl;
 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;
 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;
 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;
 cout<<"          \            .'     |                         | "<<endl;
 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;
 cout<<"        _/   _.'(             |           A SUS         | "<<endl;
 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;
 cout<<"      \  \    `-'             |                         | "<<endl;
 cout<<"        `-'                   '-------------------------' "<<endl;


return 0;

}


Programa 2 modificado con firma

#include <iostream>

#include <stdio.h>


using namespace std;

void operacion();

void areatriangulo();

void areacirculo();

void areacuadrado();


void volumencilindro();

void volumencubo();

void arearect();

int b,h,d,L,b1,h1,r,rec,cd,opc,h3,h4;

  float tr,cir,cil,cub;


int main()

{

    cout << " . Menu de opciones" << endl;

    cout << " 1. Area del triangulo" << endl;

    cout << " 2. Area del circulo" << endl;

    cout << " 3. Area del cuadrado" << endl;

    cout << " 4. Area del rectangulo" << endl;

    cout << " 5. Volumen del cilindro" << endl;

    cout << " 6. Volumen del  cubo" << endl;


 operacion();

   return 0;

}


 void operacion()

 {

     cout << "ELIGE UNA OPCION DE LAS ANTERIORES" << endl;

     cin >> opc;


     if (opc == 1)

     {

         cout << "ELEGISTE AREA DE UN TRIANGULO" << endl;

         areatriangulo();

     }


     else if (opc == 2)

     {

         cout << "ELEGISTE AREA DE UN CIRCULO" << endl;

         areacirculo();

     }


      else if (opc == 3)

     {

         cout << "ELEGISTE AREA DE UN CUADRADO" << endl;

         areacuadrado();

     }


     else if (opc == 4)

     {

         cout << "ELEGISTE AREA DE UN RECTANGULO" << endl;

         arearect();

     }


     else if (opc == 5)

     {

         cout << "ELEGISTE VOLUMEN DE UN CILINDRO" << endl;

         volumencilindro();

     }


     else if (opc == 6)

     {

         cout << "ELEGISTE VOLUMEN DE UN CUBO" << endl;

         volumencubo();

     }




 }


 void areatriangulo()

 {

 cout<<"INGRESA LA BASE"<<endl;

 cin>>b;

 cout<<"INGRESA LA ALTURA"<<endl;

 cin>>h;

 tr= b*h/2;

 cout<<"EL AREA DEL TRIANGULO ES "<<tr<<endl;


 }


 void areacirculo()

 {

 cout<<"INGRESA EL RADIO"<<endl;

 cin>>r;

 cir= 3.14*(r*r);

 cout<<"EL AREA DEL CIRCULO ES "<<cir<<endl;

 }


 void areacuadrado()

 {

  cout<<"INGRESA EL LADO"<<endl;

  cin>>L;

  cd= L*L;

  cout<<"EL AREA DEL CUADRADO ES"<<cd<<endl;


 }


 void arearect()

 {

  cout<<"INGRESA LA BASE"<<endl;

  cin>>b1;

  cout<<"INGRESA LA ALTURA"<<endl;

  cin>>h1;

  rec= b1*h1;

  cout<<"EL AREA DEL RECTANGULO ES "<<rec<<endl;


 }


 void volumencilindro()

 {

 cout<<"INGRESA EL RADIO"<<endl;

 cin>>r;

 cir= 3.14*(r*r);

 cout<<"EL AREA DE UN CIRCULO"<<cir<<endl;

 cout<<"INGRESA LA ALTURA"<<endl;

 cin>>h3;

 cil=cir*h3;

 cout<<"EL AREA CILINDRO ES "<<cil<<endl;

 }


 void volumencubo()

 {

  cout<<"INGRESA LA ALTURA"<<endl;

  cin>>h4;

  cub=cd*h4;

  cout<<"EL VOLUMEN DEL CUBO ES "<<cub<<endl;


  cout<<"                           __                             "<<endl;

 cout<<"                         .'  '.                           "<<endl;

 cout<<"                    _.-'/  |  \                           "<<endl;

 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;

 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;

 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;

 cout<<"          \            .'     |                         | "<<endl;

 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;

 cout<<"        _/   _.'(             |           A SUS         | "<<endl;

 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;

 cout<<"      \  \    `-'             |                         | "<<endl;

 cout<<"        `-'                   '-------------------------' "<<endl;






}


Programa 1 modificado con la firma

#include <iostream>
#include <cstdlib>

using namespace std;
void imprime();
int i, cont = 0;
long long int serie[89];

int main(){
    imprime();

 return 0;
}
void imprime()
{
    serie[0] = 0;
    serie[1] = 1;
    for(i=1; i < 89; i++){
        serie[i+1] = serie[i-1] + serie[i];
    }

    for(i=0; i < 12; i++){
        if (cont == 12){
            cout << "\n";
            cont = 0;
        }
        cout << serie[i] << " | ";
        cont += 1;
    }


   cout<<"                           __                             "<<endl;
 cout<<"                         .'  '.                           "<<endl;
 cout<<"                    _.-'/  |  \                           "<<endl;
 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;
 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;
 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;
 cout<<"          \            .'     |                         | "<<endl;
 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;
 cout<<"        _/   _.'(             |           A SUS         | "<<endl;
 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;
 cout<<"      \  \    `-'             |                         | "<<endl;
 cout<<"        `-'                   '-------------------------' "<<endl;



}

Firma

#include <iostream>

using namespace std;

int main()
{
   cout<<"                           __                             "<<endl;
 cout<<"                         .'  '.                           "<<endl;
 cout<<"                    _.-'/  |  \                           "<<endl;
 cout<<"                 _.-  ,|  /  0 `-.                        "<<endl;
 cout<<"          |\    .-       `---.__.'=====================-, "<<endl;
 cout<<"       \ '-'`        .___.--._)=========================| "<<endl;
 cout<<"          \            .'     |                         | "<<endl;
 cout<<"          |     /,_.-'        |        GUSTAVO          | "<<endl;
 cout<<"        _/   _.'(             |           A SUS         | "<<endl;
 cout<<"      /  ,-' \  \             |        ORDENES          | "<<endl;
 cout<<"      \  \    `-'             |                         | "<<endl;
 cout<<"        `-'                   '-------------------------' "<<endl;

    return 0;
}

Programa nuevo 9

#include <iostream>
#include <stdio.h>
using namespace std;
int n,n1,n2,j;
int main()
{
    n1=1;
    n2=1;
    cout <<n1<<endl;
    cout <<n2<<endl;
        while(n<6765)
    {
        n=n1+n2;
        cout <<n<<endl;;
        n1=n2;
        n2=n;
    }
    return 0;
}

Programa nuevo 8

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

using namespace std;

int calificaciones[20],aprobados[20],reprobados[20];
int j,ap=0,rp=0,h;

int main()
{
  cout<<"Captura 20 calificaciones del 1 al 10"<<endl;

   for(j=0;j<=19;j++)
   {
       cout<<"Ingresa calificacion"<<endl;
       cin>>calificaciones[j];
   }
   for(h=0;h<=19;h++)
       {
       if(calificaciones[h]>=7)
           {
       aprobados[ap]=calificaciones[h];

       ap++;
           }

   if(calificaciones[h]<7)
   {
       reprobados[rp]=calificaciones[h];

       rp++;
   }
       }

   cout<<"Aprobados"<<endl;

    for(j=0;j<=ap;j++)
       {


       cout<<aprobados[j]<<endl;
    }

    cout<<"Reprobados"<<endl;

     for(h=0;h<=rp;h++)
       {

       cout<<reprobados[h]<<endl;
    }
   return 0;
}