Foro de elhacker.net

Programaci๓n => Programaci๓n C/C++ => Mensaje iniciado por: Black Lotus en 21 Junio 2013, 01:02 am



Título: Programa de Control en la Contabilidad de una empresa c++
Publicado por: Black Lotus en 21 Junio 2013, 01:02 am
En el siguiente programa hay 4  opciones en el Men๚:
Productos
Factura
Reporte
Salir
entonces serแ que me podrํan ayudar con lo siguiente: que en la primera opci๓n esta producto entonces cuando se ingrese los productos  entonces se crea un registro, ese registro lo mostramos como un reporte y queda guardado entonces cuando ingresemos los datos dentro de la factura que nos reste los  productos vendidos al reporte ya que no se como restar lo que vendo en la factura con mi reporte… Desde ya muchas gracias… Para llegar a registrar productos se entra por la opci๓n 1 del menu principal, despues en la opci๓n Crear archivo, despues de registrar los productos se le da que ya no se quiere registrar mแs productos y luego se va en la opci๓n que dice: Reporte ahํ se mira todo los productos registrado.. despues en la opci๓n Salir.... despues en el men๚ principal se le da en la opci๓n 2 que es Factura, luego en Facturaci๓n y se rellena los datos que se requieren...

PD: en sํ el problema es el siguiente: no puedo restar lo que se facturo al Reporte que esta hecho, si me dicen como hacerlo les agradecer้ mucho.



Código
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <string.h>
  4. #include <stdlib.h>
  5. # include <iostream>
  6. # include <dos>
  7. # include <ctype>
  8. # include <windows>
  9. #include <time>
  10. #include <fstream>
  11. FILE *fp;
  12. FILE *fp1;
  13. struct inven{
  14.  char codigo[10];
  15.  char descrip[30];
  16.  char exist[15];
  17.  char preuni[5];
  18. }inventario;
  19.  
  20. //  ===  funciones ===
  21. void crear();
  22. void salir();
  23. void menu();
  24. void producto();
  25. void anexar();
  26. void modificar();
  27. void eliminar();
  28. void reporte();
  29. //  ===  funciones factura ===
  30. void registrar_productos(int nv, int np);
  31.  
  32.  
  33.  
  34.  
  35.  
  36. // ---44444444444444444444444444 PROGRAMA factura 444444444444444444444444----------------------------
  37.   #define MAXCAD 50
  38. #define MAX_V 1000
  39. #define MAX_PV 100    // maximo de productos vendidos
  40. time_t t = time(0);   // get time now
  41. struct tm * now = localtime( & t );
  42. void unidades_en_letra(unsigned long cantidad);
  43.  void millares_en_letra(unsigned long cantidad);
  44. void millones_en_letra(unsigned long cantidad);
  45.   const char *unidades[] = {NULL,"Uno","Dos", "Tres", "Cuatro","Cinco","Seis","Siete","Ocho","Nueve"};
  46. const char *decimas[] = {NULL,"Dies","Veinte","Treinta","Cuarenta","Cincuenta","Sesenta","Setenta","Ochenta","Noventa"};
  47. const char  *diez_y[] = {NULL,"Once","Doce","Trece","Tatorce","Quience"};
  48. const char *centenas[] = {NULL,"Ciento",NULL,NULL,NULL,"Quinientos",NULL,"Setecientos",NULL,"Novecientos"};
  49.  
  50. struct unProducto {
  51.    char name_prod[MAXCAD];  // nombre del producto
  52.    int  cantidad;
  53.    int  precio  ;
  54.    int  subtotal;
  55. };
  56.  
  57. struct variosProductos {
  58.    int numProd ;             // numero de productos
  59.    unProducto vp[MAX_PV];      //varios productos cada uno en una posicion del  vector
  60.    int precioTotal ;
  61. };
  62.  
  63. struct Vendedor {
  64.    char nombre[MAXCAD]   ;
  65.    char apellido[MAXCAD] ;
  66.    char direccion[MAXCAD];
  67.    int  DNI     ;
  68.    variosProductos P  ;
  69. };
  70.  
  71. struct Vendedor lista[MAX_V]; // creamos un array de
  72. struct Vendedor aux;
  73.  
  74.  
  75. void registrar_productos(int nv, int np){
  76. {
  77.    // nv -> numero
  78.    unsigned long cantidad;
  79.      int ti,tt,iva;
  80.  
  81.  
  82.        gotoxy(4,6); cout<<"Cantidad";
  83.        gotoxy(18,6);cout<<"Descripcion" ;
  84.        gotoxy(66,6);cout<<"Precio";
  85.    for(int i=0; i<np; i++)
  86.    {
  87.  
  88.  
  89.  
  90.        gotoxy(4,8+i);cin>> lista[nv].P.vp[i].cantidad ;
  91.        cin.ignore();
  92.        gotoxy(18,8+i);cin.getline( lista[nv].P.vp[i].name_prod, MAXCAD );
  93.  
  94.        gotoxy(66,8+i);cin>> lista[nv].P.vp[i].precio ;
  95.  
  96.  
  97.  
  98.        lista[nv].P.vp[i].subtotal = lista[nv].P.vp[i].cantidad * lista[nv].P.vp[i].precio ;  // subtotal
  99.  
  100.        if(lista[nv].P.vp[i].subtotal==0)
  101.  
  102.        lista[nv].P.precioTotal = lista[nv].P.precioTotal +  lista[nv].P.vp[i].subtotal ;
  103.  
  104.    }
  105.    ti=0;
  106.    tt=0;
  107.    iva=0;
  108.    for(int i=0; i<np; i++){
  109.      ti=(ti+(lista[nv].P.vp[i].cantidad*lista[nv].P.vp[i].precio));
  110.         }
  111.         iva=(ti*0.12);
  112.         tt=(ti - iva);
  113.   cantidad=ti;
  114.  
  115.    gotoxy(30,18);cout<<"Total Sin Impuesto";
  116.      gotoxy(66,18);cout<<tt;
  117.      gotoxy(30,19);cout<<"Impuesto 12%";
  118.      gotoxy(66,19);cout<<iva;
  119.      gotoxy(36,21);cout<<"Total";
  120.      gotoxy(66,21);cout<<ti;
  121.      gotoxy(5,23);cout<<"En Letreas:";
  122.      gotoxy(18,23);millones_en_letra(cantidad);
  123.      cout<<"  Quetzales";
  124. getch();
  125. }
  126. }
  127. void registrar_vendedores(int n)
  128. {
  129.  
  130. for(int i=0; i<n; i++)
  131.    {
  132.     clrscr();
  133.      cout<<" ษอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออป";
  134. cout<<"   บ                                                                           บ"<<endl;
  135.      cout<<" บ                                                                           บ"<<endl;
  136.      cout<<" บ                                                                           บ"<<endl;
  137. cout<<" ฬอออออออออออหอออออออออออออออออออออออออออออออออออออออออออออออออหอออออออออออออน"<<endl;
  138. cout<<" บ           บ                                                 บ             บ"<<endl;
  139.      cout<<" ฬอออออออออออฮอออออออออออออออออออออออออออออออออออออออออออออออออฮอออออออออออออน"<<endl;
  140. cout<<" บ           บ                                                 บ             บ"<<endl;
  141. cout<<" บ           บ                                                 บ             บ"<<endl;
  142. cout<<" บ           บ                                                 บ             บ"<<endl;
  143. cout<<" บ           บ                                                 บ             บ"<<endl;
  144. cout<<" บ           บ                                                 บ             บ"<<endl;
  145. cout<<" บ           บ                                                 บ             บ"<<endl;
  146.      cout<<" บ           บ                                                 บ             บ"<<endl;
  147.      cout<<" บ           บ                                                 บ             บ"<<endl;
  148.      cout<<" บ           บ                                                 บ             บ"<<endl;
  149.     cout<<" ฬอออออออออออฮอออออออออออออออออออออออออออออออออออออออออออออออออฮอออออออออออออน"<<endl;
  150.      cout<<" บ           บ                                                 บ             บ"<<endl;
  151.      cout<<" บ           บ                                                 บ             บ"<<endl;
  152. cout<<" ฬอออออออออออฮอออออออออออออออออออออออออออออออออออออออออออออออออฮอออออออออออออน"<<endl;
  153.      cout<<" บ           บ                                                 บ             บ"<<endl;
  154.      cout<<" ฬอออออออออออสอออออออออออออออออออออออออออออออออออออออออออออออออสอออออออออออออน"<<endl;
  155.      cout<<" บ                                                                           บ"<<endl;
  156.      cout<<" ศอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ"<<endl;
  157.  
  158.        cin.ignore(); gotoxy(4,2);cout << "   Nombres : ";  cin.getline( lista[i].nombre, MAXCAD   );
  159.        gotoxy(25,2);cout << "   Apellidos : ";  cin.getline( lista[i].apellido, MAXCAD );
  160.        gotoxy(4,3); cout << "   N I T : ";  cin>>lista[i].DNI;
  161.        gotoxy(25,3); cout<<"> Numero de productos: ";      cin>> lista[i].P.numProd ;
  162.        cin.ignore(); gotoxy(4,4); cout << "   Dir : ";  cin.getline( lista[i].direccion, MAXCAD);
  163.        gotoxy (27,4);cout << "Fecha: " <<(now->tm_mday ) << '/' << (now->tm_mon +1)
  164.    << '/' << (now->tm_year +1900);
  165.  
  166.  
  167.  
  168.        registrar_productos( i ,lista[i].P.numProd );
  169.  
  170.    }
  171. }
  172.  
  173. void datosVendedor(int x)
  174. {
  175. ifstream salida;
  176.   salida.open("empleados.txt",ios::in);
  177.   if(salida.fail())
  178.    {
  179.    cout<<"ocurrio un error al abrir el archivo";
  180.    getch();
  181.    }
  182.    else
  183.        {
  184.        salida>>lista[x].nombre;
  185.  
  186.        } {
  187.      cout<<endl<<endl;
  188.  
  189.  
  190.        cout <<"   Nombre   :  " << lista[x].nombre <<' '<< lista[x].apellido << endl;
  191.        cout<< "   Productos vendidos:"<<lista[x].P.numProd<< endl;
  192.        cout << "   N I T    :  "<< lista[x].DNI       << endl;
  193.        cout << "   Direccion:  "<< lista[x].direccion << endl;
  194.         cout << "   fecha:  "<<(now->tm_mday ) << '/' << (now->tm_mon +1)<< '/' << (now->tm_year +1900)<<endl;
  195.  
  196.  
  197.        }
  198. }
  199.  
  200. void prodVendedor(int x, int num)
  201. {
  202.  
  203. int ti;
  204.    if(num>0)
  205.    {
  206.        cout<<endl<<endl;
  207.        cout << "   Productos de " << lista[x].nombre <<' '<< lista[x].apellido << endl<<endl;
  208.  
  209.        for(int i=0; i<lista[x].P.numProd; i++)
  210.        {
  211.            cout<<"\n   Producto "<< (i+1)                      <<endl;
  212.            cout<<"\tNombre  : " << lista[x].P.vp[i].name_prod  <<endl;
  213.            cout<<"\tCantidad: " << lista[x].P.vp[i].cantidad <<endl;
  214.            cout<<"\tPrecio  : " << lista[x].P.vp[i].precio     <<endl;
  215.            cout<<"\tSubtotal: " << lista[x].P.vp[i].subtotal <<endl ;
  216.            ti=(ti+(lista[x].P.vp[i].cantidad*lista[x].P.vp[i].precio));
  217.        }
  218.  
  219.  
  220.  
  221.        cout<<endl;
  222.        cout<<"  ---------------------------"<<endl;
  223.        cout<<"  PRECIO TOTAL:   "<< (ti-1);
  224.    }
  225.    else
  226.        cout<<"\n\tRegistro vacio..!";
  227.  
  228. }
  229.  
  230. void mostrar_productos(int nv)
  231. {
  232.  
  233.  
  234.    cout<<"   Productos: \n\n";
  235.    cout<<"\t";
  236.    cout<<"Cantidad";
  237.    cout<<"\t";
  238.    cout<<"Descripcion";
  239.    cout<<"\t\t\t\t";
  240.    cout<<"Precio";
  241.    cout<<endl;
  242.    for(int i=0; i<lista[nv].P.numProd; i++)
  243.    {
  244.       cout<<"\t";
  245.     cout<<lista[nv].P.vp[i].cantidad;
  246.       cout<<"\t\t";
  247.       cout<<lista[nv].P.vp[i].name_prod;
  248.       cout<<"\t\t\t\t";
  249.       cout<<lista[nv].P.vp[i].precio<<endl;
  250.    }
  251. }
  252.  
  253. void mostrar_vendedores(int num)
  254. {     for(int i=0; i<num; i++)
  255.    if( num>0)
  256.    {
  257.        cout<<"\n\nMostrando lista de Clientes\n";
  258.  
  259.         {
  260.      cout<<endl<<endl;
  261.  
  262.  
  263.        cout <<"   Nombre   :  " << lista[i].nombre <<' '<< lista[i].apellido << endl;
  264.        cout<< "   Productos vendidos:"<<lista[i].P.numProd<< endl;
  265.        cout << "   N I T    :  "<< lista[i].DNI       << endl;
  266.        cout << "   Direccion:  "<< lista[i].direccion << endl;
  267.         cout << "   fecha:  "<<(now->tm_mday ) << '/' << (now->tm_mon +1)<< '/' << (now->tm_year +1900)<<endl;
  268.  
  269.  
  270.  
  271.            cout<<endl;
  272.  
  273.        }
  274.    }
  275.    else
  276.        cout<<"\n\tRegistro vacio..!";
  277. }
  278.  
  279. void eliminar_vendedor( int x, int &num)
  280. {
  281.    if(num>0)
  282.    {
  283.        for(int i=x; i<num-1; i++)
  284.            lista[i] = lista[i+1];
  285.  
  286.        num--;
  287.    }
  288.    else
  289.        cout<<"\n\tRegistro vacio..!";
  290.  
  291. }
  292.  
  293. void buscar_vendedor( int num)
  294. {
  295.    int band = 0;
  296.  
  297.    if(num>0)
  298.    {
  299.        for(int i=0; i<num; i++)
  300.        {
  301.            if(lista[i].DNI==aux.DNI)
  302.            {
  303.                cout<<"\n\n La direccion de "<<lista[i].nombre<<" "
  304.                    <<lista[i].apellido<<" es : "
  305.                    <<lista[i].direccion <<endl ;
  306.                band = 1 ;
  307.                break;
  308.            }
  309.        }
  310.    }
  311.    else
  312.        cout<<"\n\tRegistro vacio..!";
  313.  
  314.    if(band==0)
  315.        cout<<"\n\n\tEl cliente no fue encontrado..! :S"<<endl;
  316.  
  317. }
  318.  
  319. void menu1()
  320. {
  321.    clrscr();
  322.    cout<<"\n\t\tFacturacion de Clientes\n\n";
  323.    cout<<" 1. Facturacion                       "<<endl;
  324.    cout<<" 2. Mostrar registro de clientes y productos "<<endl;
  325.    cout<<" 3. Mostrar datos de un cliente               "<<endl;
  326.    cout<<" 4. Mostrar productos vendidos al cliente  "<<endl;
  327.    cout<<" 5. Eliminar cliente del registro             "<<endl;
  328.    cout<<" 6. Buscar direccion de cliente por N I T     "<<endl;
  329.    cout<<" 7. Salir                                      "<<endl;
  330.  
  331.    cout<<"\n Ingrese opcion : ";
  332. }
  333.  
  334. /*                      funcion principal
  335. ------------------------------------------------------------------------------*/
  336. void factura() {
  337.  
  338.    int num=0;  // numero
  339.    int op;   // opcion del menu
  340.    int num_vendedor ;
  341.  
  342.    system("color 0b");
  343.  
  344.    do
  345.    {
  346.        menu1();  cin>> op;
  347.  
  348.        switch(op)
  349.        {
  350.            case 1:
  351.  
  352.  
  353.                cout<<"\n Numero de clientes: ";
  354.                cin>> num;     clrscr();
  355.                registrar_vendedores(num);  cout<<endl;
  356.                break;
  357.  
  358.            case 2:
  359.             clrscr();
  360.                mostrar_vendedores(num);
  361.                break;
  362.  
  363.            case 3:
  364.                cout<<"\n Ingrese numero de cliente: ";
  365.                cin>> num_vendedor ;
  366.                datosVendedor( num_vendedor-1);
  367.                break;
  368.  
  369.            case 4:
  370.                cout<<"\n Ingrese numero de cliente: ";
  371.                cin>> num_vendedor ;
  372.                prodVendedor( num_vendedor-1, num);
  373.                break;
  374.  
  375.            case 5:
  376.                cout<<"\n Ingrese numero de cliente: ";
  377.                cin>> num_vendedor ;
  378.                eliminar_vendedor( num_vendedor-1, num);
  379.                cout<<"\n\n\t\tCliente eliminado ..!"<<endl;
  380.                break;
  381.  
  382.            case 6:
  383.                cout<<"\n Ingrese numero de N I T: ";
  384.                cin>> aux.DNI;
  385.                buscar_vendedor(num);
  386.                break;
  387.            case 7:
  388.            menu();
  389.  
  390.        }
  391.  
  392.        cout<<endl<<endl;
  393.        getch();
  394.    }while(op!=7);
  395.  
  396.  
  397.  
  398. }
  399.  
  400. void unidades_en_letra(unsigned long cantidad)
  401. {
  402.  unsigned char unidad = cantidad % 10;
  403.  unsigned char decima = (cantidad/10)% 10;
  404.  unsigned char centena = (cantidad/100)% 10;
  405.  if(centena!=0)
  406.   if(centenas[centena]==0)
  407.    cout<<unidades[centena]<<"Cientos";
  408.    else if (centena!=1 || unidad!=0 || decima!=0)
  409.    cout<<centenas[centena];
  410.    else
  411.    cout<<"Cien";
  412.    if(unidad!=0 || decima!=0)
  413.    {
  414.    if (centena!=0)
  415.    cout<<" ";
  416.     if (decima==0)
  417.     cout<<unidades[unidad];
  418.     else if ( unidad==0)
  419.     cout<<decimas[decima];
  420.     else if (decima==1 && unidad>=1 && unidad<=5)
  421.     cout<<diez_y[unidad];
  422.      else if (decima==1)
  423.      cout<<"Dieci"<<unidades[unidad];
  424.       else if (decima==2)
  425.       cout<<"Veinti"<<unidades[unidad];
  426.       else
  427.       cout<<decimas[decima]<<" y "<<unidades[unidad];
  428.  
  429.    }
  430.  
  431. }
  432.  void millares_en_letra(unsigned long cantidad)
  433.  {
  434.    unsigned long unidades = cantidad % 1000;
  435.    unsigned long miles = (cantidad / 1000) % 1000;
  436.    if(miles>1)
  437.    unidades_en_letra(miles);
  438.     if(miles!=0)
  439.     cout<<"Mil";
  440.     if(unidades!=0 && miles!=0)
  441.     cout<<" ";
  442.     unidades_en_letra(unidades);
  443.  
  444.  }
  445.   void millones_en_letra(unsigned long cantidad)
  446.   {
  447.  
  448.   unsigned long unidades = cantidad % 1000000;
  449.    unsigned long millares = (cantidad / 1000000)% 1000000;
  450.     if(millares>1)
  451.     {
  452.  millares_en_letra(millares);
  453.    cout<<"Millones";
  454.       }
  455.       else if(millares!=0)
  456.       cout<<"Un Mill\242n";
  457.       if(unidades!=0 && millares!=0)
  458.       cout<<" ";
  459.       millares_en_letra(unidades);
  460.       }
  461.  // ---44444444444444444444444444 PROGRAMA factura 444444444444444444444444----------------------------
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469. // ---44444444444444444444444444 PROGRAMA producto 444444444444444444444444----------------------------
  470. void producto()
  471. {
  472.  
  473.  char resp;
  474.  
  475.  do
  476.  {
  477.    clrscr();
  478.    printf("\n\n\t\t\t* * * * * MENU DE OPCIONES * * * * *");
  479.    printf("\n\t\t---------------------------------------------------");
  480.    printf("\n\t\t\t      ALTA Y CONTROL DE PRODUCTOS   ");
  481.    printf("\n\t\t-------------------------------------------------\n\n\n\n");
  482.    printf("\t\t\t\t (1) Crear Archivo  \n");
  483.    printf("\t\t\t\t (2) Reporte              \n");
  484.    printf("\t\t\t\t (3) Salir  ........        ");
  485.    printf("\n\n\t\t\t\tSelecciona: ");
  486.    resp=getchar();
  487.    switch(resp)
  488. {
  489.  case '1': crear();
  490. break;
  491.  
  492.  case '2': reporte();
  493. break;
  494.  case '3' : menu();
  495.    }
  496.  }
  497.  while(resp!='3');
  498.  getch();
  499. }
  500. // === Funcion de crear un archivo ====
  501. void crear()
  502. {
  503.   clrscr();
  504.   char opcion = 's';
  505.   if ((fp=fopen("inventario.dat","ab"))==NULL)
  506.      printf("\n\n\n\n\t\t< < < Error de apertura de archivo inventario.dat   > > >");
  507.   else
  508.   {
  509.     while(opcion == 's'){
  510.        printf("\n\n Escribe la Clave del Producto (No exceder de 16 digitos):\t ");
  511.        scanf("%s",&inventario.codigo);
  512.        printf("\n\n Escribe el Nombre del Producto\t ");
  513.        scanf("%s", &inventario.descrip);
  514.        printf("\n\n Escribe la Existencia del Producto:\t ");
  515.        scanf("%s", &inventario.exist);
  516.        printf("\n\n Escribe el Precio Unitario del Producto:\t ");
  517.        scanf("%s",&inventario.preuni);
  518.        fwrite(&inventario, sizeof(inventario), 1, fp);
  519.        printf("\n\n\n\t\t Desea Capturar Otro Producto [s/n] : ");
  520.     opcion = getchar();
  521.        getch();
  522.         }
  523.         }
  524.         fclose(fp);
  525. }
  526. //////////////////anexar/////////////////////////////
  527. //// ====================================reporte de productos//////////
  528. void reporte (){
  529.  
  530. int i;
  531. clrscr();     // limpia la pantalla
  532. FILE *invent;   //Asigna un apuntador de tipo archivo
  533. invent = fopen("inventario.dat", "r");   //verifica la apertura en modo lectura del archivo en donde se almacena la informacion
  534. if(invent == NULL) // si el valor del apuntador es iguala NULO
  535. {
  536. printf("\nNo existe archivo");  // manda un mensaje de que no existe el archivo
  537. }
  538.       fread(&inventario, sizeof(struct inven), 1, invent);
  539.     printf("------------------------------------------------------------------\n");
  540.        printf("CODIGO   DESCRIPCION\t\tEXISTENCIA\tPRECIO UNITARIO  \n");
  541.                       printf("------------------------------------------------------------------\n");
  542. while(!feof(invent)) //mientras no sea fin de archivo
  543. {
  544.      gotoxy(2,i);
  545.  printf("  %s      %s\t\t   %s\t\t      %s \n",inventario.codigo,inventario.descrip,inventario.exist,inventario.preuni);
  546.      gotoxy(9,i);
  547.       fread(&inventario, sizeof(struct inven), 1, invent);
  548.   }
  549.     fclose(invent); // cierra el archivo
  550. getch();
  551.     menu();
  552.   }
  553. // ---44444444444444444444444444 PROGRAMA PRINCIPAL 444444444444444444444444----------------------------
  554. void caratula()
  555. {
  556.  
  557. }
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566. void menu()
  567. {
  568.  
  569.    int opcion;
  570.  
  571.         clrscr() ;
  572.           caratula();
  573.  
  574.         clrscr() ;
  575.         int op;
  576. cout<<endl<<endl<<" ษอออออออออออออออออออออออออออออออออออออออออออออออออป"<<endl;
  577. cout<<" บ                                                 บ"<<endl;
  578.      cout<<" บ                                                 บ"<<endl;
  579.      cout<<" บ                                                 บ"<<endl;
  580. cout<<" บ                                                 บ"<<endl;
  581. cout<<" ฬอออออออออออออออออออออออออออออออออออออออออออออออออน"<<endl;
  582. cout<<" บ                                                 บ"<<endl;
  583. cout<<" บ                                                 บ"<<endl;
  584. cout<<" บ                                                 บ"<<endl;
  585. cout<<" บ                                                 บ"<<endl;
  586. cout<<" บ                                                 บ"<<endl;
  587. cout<<" บ                                                 บ"<<endl;
  588.      cout<<" บ                                                 บ"<<endl;
  589.      cout<<" บ                                                 บ"<<endl;
  590. cout<<" บ                                                 บ"<<endl;
  591.      cout<<" ศอออออออออออออออออออออออออออออออออออออออออออออออออผ"<<endl;
  592.  
  593.  
  594. gotoxy(30,5);cout<<"HOLA A TODOS SOY UNA PRUEBA";
  595. gotoxy(36,6);cout<<"PROGRAMACION";
  596. gotoxy(25,10);cout<<"1) Producto";
  597. gotoxy(25,12);cout<<"2) Factura";
  598. gotoxy(25,13);cout<<"3) Reporte";
  599. gotoxy(25,14);cout<<"4) Salir";
  600. gotoxy(25,16);cout<<"Su opci\242n es:  ";
  601. gotoxy(40,16);cin>>opcion;
  602.        clrscr();
  603.        switch(opcion)
  604.        {
  605.  
  606.        case 1:
  607.            producto();
  608.             system("CLS");
  609.            break;
  610.  
  611.            break;
  612.        case 2:
  613.             factura();
  614.            system("CLS");
  615.            break;
  616.        case 3:
  617.        reporte ();
  618.         system("CLS");
  619.         break;
  620.         case 4:
  621.            salir();
  622.            system("CLS");
  623.            break;
  624.        default:
  625.            cout<< "La opci๓n ingresada no es valida, seleccione de nuevo. \n";
  626.            break;
  627.  
  628.        }
  629.  
  630. }
  631.  
  632. int main(){
  633. menu();
  634. return 0;
  635. }
  636. void salir()
  637. {
  638. clrscr();cout<<"Vale, Adi\242s";
  639. getch();
  640. }
  641.  


PD: El programa aun no esta completo, por eso lleva librerias, codigo extras :)