Viernes, 09 de Enero del 2009

Tagline gratis de hoy: Duplica tu disco duro, ¡Borra el Windows!

 
Inicio Descargas Foros Tu Cuenta Web Links  
Crear Una Cuenta
Menú Principal
Inicio (Noticias):
 Inicio
 Enviar Noticia
 Mapa de Noticias
 Noticias en Tu Web
 Noticias Destacadas
 Archivo de Noticias
 Búscar
 Topicos
Miembros:
 Lista de Usuarios
 Tu Cuenta
 Diario de Usuarios
 Mensaje Privados
 Comunidad:
 Foros de Aclantis
 Recetas de Cocina Gratis
 Juegos Gratis
 AvantGo de Descargas
 Buscar en Google
 Webs Amigas
 Bromas y Chistes
 Trucos de Juegos
 Trucos de Informática
 Guías y Análisis de Juegos
 Publicidad y Intercambios
 Referirnos
 Contáctenos
  Web Links
 
  Descargas
 
Estadísticas:
 Estadísticas
 Site Map
 Top 20
 Encuestas
Documentaciones:
 Artículos
 Agregar a Favoritos
 Herramientas WebMasters
 FAQ De Aclantis
Recomendados


Noticias recientes
Miércoles, 07 enero
· Firmas tecnológicas buscarán fusiones y compras seguras en 2009
· Cambios en la iTunes Store: Todas las canciones estarán libres de DRM
· Apple desvela iWork 09
· Motorola presenta el primer móvil fabricado con material reciclado de botellas
· Apple presenta iLife 09
· A través del móvil acosan a mujeres en el metro de México
· Decepción total en la última keynote de Apple
· Intel y Adobe ampliarán la plataforma Flash para TV
· Conoce los mejores campos de golf de la Riviera Maya
Martes, 06 enero
· Wii Sports se convierte en el juego más vendido de la historia

Artículos Viejos
Aclantis: Forums

Aclantis :: Ver tema - proyect
Login Registrarse FAQ Miembros Buscar

Foros de discusión -> Programación -> proyect
Publicar nuevo tema  Responder al tema Ver tema anterior :: Ver tema siguiente 
proyect
MensajePublicado: Vie Ene 06, 2006 5:16 am Responder citando
carlys_18
Invitado
 




aca tengo mi codigo.. solo tengo el registro de lkos datos pero no se como trabajar con las listas..

//________Declaracion de las Librerias a usar______//
//_________________________________________________//

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


//_______________Variables_________________//

int a=0;

struct datos { //__Registro que almacena todos los datos de un Trabajadores__//
char nombre[20]; //__Nombre del Trabajador__//
char direccion[20]; //__Direccion del Trabajador__//
int CI; //__Cedula de Identidad del Trabajador__//
long telefono, monto; //__Telefono y montodel prestamo del Trabajador__//
char edoCivil; //__Estado Civil del Trabajador__/
char razon; //__Razon del Prestamo del Trabajador__//
int fecha; //__Fecha de Solicitud del Trabajador__//
} arreglo[19];

datos*listas;

void main () {
datos*nodo;
clrscr(); // limpia la pantalla//

gotoxy(9,7); //Ubica la posiciomn en la pantalla//
cout<<"BIENVENIDOS AL CENTRO PRIVADO DE FINANCIAMIENTO Y CREDITO ASOMEZCLA";
gotoxy(9,6 );
cout<<"--------------------------------------------------------------------";
gotoxy(9,8 );
cout<<"--------------------------------------------------------------------";
gotoxy(9,5 );

gotoxy(2,13);
cout<<"***Presione la tecla Enter para iniciar el funcionamiento del sistema***";
getchar ();
clrscr ();
cout<<" ***Que desea Hacer?***Sad ) ";
getchar();
for (int i=0; i<=1; i++) //Ciclo que inicializa el registro de los datos de los Trabajadores//
{ // inicio del ciclo for//
clrscr(); // limpia la pantalla//
gotoxy(28,4); // ubica la posici¢n en la pantalla//
cout<<"Ingrese Datos Del Trabajador\n";
gotoxy(28,3);
cout<<"---------------------------";
gotoxy(28,5);
cout<<"---------------------------";
gotoxy(28,6);
cout <<" Nombre: ";
cin >> arreglo[i].nombre;
gotoxy(28,Cool;
cout <<" Cedula de Identidad: ";
cin >> arreglo[i].CI;
gotoxy(28,10);
cout <<" Direccion: ";
cin >> arreglo[i].direccion;
gotoxy(28,12);
cout <<" Telefono:";
cin >> arreglo[i].telefono;

gotoxy(28,14);
cout <<" Estado Civil:";
cin >> arreglo[i].edoCivil;

gotoxy(28,16);
cout <<" Razon del Prestamo:";
cin >> arreglo[i].razon;

gotoxy(28,1Cool;
cout <<" Monto:";
cin >> arreglo[i].monto;

gotoxy(28,20);
cout <<" Fecha de Solicitud:";
cin >> arreglo[i].fecha;

} //Cierra el ciclo del for//


clrscr();

gotoxy(8,5);
cout<<"***Si desea ver informacion de las solicitudes escoga una de las siguientes opciones***Sad ) ";
gotoxy(69,5);
i=0; //inicializa la variable//
}
MensajePublicado: Vie Ene 06, 2006 8:15 am Responder citando
BillyToro
Adulto, como en casa.
Adulto, como en casa.
 
Registrado: Nov 12, 2005
Mensajes: 274
Ubicación: Asteroid B-612




Incompleto y en necesidad de trabajo; pero para que te sirva de guía:

Proyecto1.cpp
Código:
///////////////////////////////////////////////////////////////////////////
// CProject1 -- Implementation for CProject1 object


#include "stdafx.h"
#include "Project1.h"

IMPLEMENT_SERIAL(CProject1, CObject, 0);


////////////////////////////////////////////////////////////
// CProject1List class members


CProject1* CProject1List::FindProject1(COleDateTime dtDate, CString strNombre, int nMontante, int nCI)
{
   POSITION Pos = FindProject1Pos(dtDate, strNombre, nMontante, nCI);
   if (Pos == NULL) return NULL;
   return (CProject1*)GetAt(Pos);
}


POSITION CProject1List::FindProject1Pos(COleDateTime dtDate, CString strNombre, int nMontante, int nCI)
{
   POSITION Pos;
   CProject1* pProject1;
   div_t divresult;

   int nCurrent, nHigh, nLow, nCompareResult, nLastCurrent = -1;
   nLow = 0;
   nHigh = GetCount();
   divresult = div(nHigh - nLow, 2);
   nCurrent = nLow + divresult.quot;

   if (nHigh <= 0) goto l_NotFound;  // no items in the list
   while (TRUE)
   {
      Pos = FindIndex(nCurrent);
      pProject1 = (CProject1*)GetAt(Pos);
      nCompareResult = pProject1->Compare(dtDate, strNombre, nMontante, nCI);
      if (nCompareResult == 0)
      {
         return Pos;
      }
      if (nCompareResult > 0) // we are in lower half of test range
      {
         nHigh = nCurrent;
      divresult = div(nHigh - nLow, 2);
      nCurrent = nLow + divresult.quot;
      }
      else // we are in upper half of test range
      {
         nLow = nCurrent;
      divresult = div(nHigh - nLow, 2);
      nCurrent = nLow + divresult.quot;
      }
      if (nCurrent == nLastCurrent) goto l_NotFound;
      nLastCurrent = nCurrent;
   }

   l_NotFound:;

#ifdef _DEBUG
   Pos = FindProject1PosBruteForce(dtDate, strNombre, nMontante, nCI);
   if (Pos != NULL) TRACE("Searching algorithm failed\n");
#endif

   return NULL;
} // end of FindProject1Pos



POSITION CProject1List::FindProject1PosBruteForce(COleDateTime dtDate, CString strNombre, int nMontante, int nCI)
{
   CProject1* pProject1;
   POSITION Pos = GetHeadPosition();
   while (Pos)
   {
      pProject1 = (CProject1*)GetNext(Pos);
      if (pProject1->Compare(dtDate, strNombre, nMontante, nCI) == 0)
      {
         return Pos;
      }
   }
   return NULL;
} // end of FindProject1PosBruteForce



void CProject1List::AddProject1(CProject1* pNew)
{
   CProject1* pProject1;
   int nCompareResult;
   POSITION Pos;

   // need to search through list and add in the proper sorted order
   ASSERT_VALID(pNew);
   ASSERT(Find(pNew) == NULL);

   // start from end because it is more likely to be added to the end
   Pos = GetTailPosition();
   while (Pos)
   {
      pProject1 = (CProject1*)GetAt(Pos);
      nCompareResult = pProject1->Compare(pNew);
      ASSERT(nCompareResult != 0);
      if (nCompareResult == 0) return;
      if (nCompareResult == -1)
      {
         InsertAfter(Pos, pNew);
         return;
      }
      GetPrev(Pos);
   }
   AddHead(pNew);
   return;
}


void CProject1List::RemoveProject1(COleDateTime dtDate, CString strNombre, int nMontante, int nCI)
{
   POSITION Pos = FindProject1Pos(dtDate, strNombre, nMontante, nCI);
   if (Pos) RemoveAt(Pos);
}



void CProject1List::Serialize(CArchive& ar)
{
   // NOTE:  Do not call the base class!
   DWORD dwVersion = 0x00000000;
   int n, nCount;
   POSITION Pos;
   CProject1* pProject1;

   if (ar.IsStoring())
   {
      ar<<dwVersion;

      nCount = GetCount();
      ar<<nCount;
      Pos = GetHeadPosition();
      while (Pos)
      {
         pProject1 = (CProject1*)GetNext(Pos);
         pProject1->Serialize(ar);
      }
   }
   else
   {
      ar>>dwVersion;
      ASSERT(GetCount() == 0);
      ar>>nCount;
      for (n = 0; n < nCount; ++n)
      {
         pProject1 = new CProject1();
         if (pProject1 == NULL)
         THROW(new CMemoryException());
         pProject1->Serialize(ar);
         AddTail(pProject1);
      }
   }
} // end of Serialize



void CProject1List::ClearAndDelete()
{
   CProject1* pProject1;
   POSITION Pos = GetHeadPosition();
   while (Pos)
   {
      pProject1 = (CProject1*)GetNext(Pos);
      ASSERT_VALID(pProject1);
      delete pProject1;
   }
   RemoveAll();
}



////////////////////////////////////////////////////////////
// CProject1 class members



////////////////////////////////////////////
// CProject1 construction/destruction


// Construction
CProject1::CProject1()
{
   Clear();
   m_dtCreated = COleDateTime::GetCurrentTime();
}


CProject1::CProject1(COleDateTime dtDate, CString strNombre, int nMontante, int nCI)
{
   Clear();
   m_dtCreated = COleDateTime::GetCurrentTime();
   m_dtDate = dtDate;
   m_strNombre = strNombre;
   m_nMontante = nMontante;
   m_nCI = nCI;
}


// Initialization
void CProject1::Clear()
{
   m_dtDate = 0.0;
   m_strNombre = _T("");
   m_nMontante = 0;
   m_nCI = 0;
   m_strNombre = _T("");
   m_strDireccion = _T("");
   m_nCI = 0;
   m_nMontante = 0;
   m_strEstado = _T("");
   m_strRazon = _T("");
   m_dtFecha = 0.0;
   m_dtCreated = 0.0;
   m_dtLastModified = 0.0;
}



// Destruction
CProject1::~CProject1()
{



}




////////////////////////////////////////////
// CProject1 Diagnostics

#ifdef _DEBUG

void CProject1::Dump(CDumpContext& dc) const
{
   dc.SetDepth(1);
   dc <<"Date = " << m_dtDate;
   dc <<"Nombre = " << m_strNombre;
   dc <<"Montante = " << m_nMontante;
   dc <<"CI = " << m_nCI;
   dc <<"Nombre = " << m_strNombre;
   dc <<"Direccion = " << m_strDireccion;
   dc <<"CI = " << m_nCI;
   dc <<"Montante = " << m_nMontante;
   dc <<"Estado = " << m_strEstado;
   dc <<"Razon = " << m_strRazon;
   dc <<"Fecha = " << m_dtFecha;
   dc <<"Created = " << m_dtCreated;
   dc <<"LastModified = " << m_dtLastModified;
}

void CProject1::AssertValid() const
{
   CObject::AssertValid();

   // TODO:  Add validity checking here
}
#endif





////////////////////////////////////////////
// CProject1 operations


void CProject1::Serialize(CArchive& ar)
{
   DWORD dwVersion = 0x00000000;

   if (ar.IsStoring())
   {
      ar<<dwVersion;
      ar<<m_dtDate<<m_strNombre<<m_nMontante<<m_nCI<<m_strNombre<<m_strDireccion<<m_nCI<<m_nMontante<<m_strEstado<<m_strRazon<<m_dtFecha<<m_dtCreated<<m_dtLastModified;


   }
   else
   {
      ar>>dwVersion;
      ar>>m_dtDate>>m_strNombre>>m_nMontante>>m_nCI>>m_strNombre>>m_strDireccion>>m_nCI>>m_nMontante>>m_strEstado>>m_strRazon>>m_dtFecha>>m_dtCreated>>m_dtLastModified;


   }
   CObject::Serialize(ar);
} // end of Serialize


void CProject1::Duplicate(CProject1* pSource)
{
   m_dtDate = pSource->m_dtDate;
   m_strNombre = pSource->m_strNombre;
   m_nMontante = pSource->m_nMontante;
   m_nCI = pSource->m_nCI;
   m_strNombre = pSource->m_strNombre;
   m_strDireccion = pSource->m_strDireccion;
   m_nCI = pSource->m_nCI;
   m_nMontante = pSource->m_nMontante;
   m_strEstado = pSource->m_strEstado;
   m_strRazon = pSource->m_strRazon;
   m_dtFecha = pSource->m_dtFecha;
   m_dtCreated = pSource->m_dtCreated;
   m_dtLastModified = pSource->m_dtLastModified;
} // end of Duplicate


int CProject1::Compare(COleDateTime dtDate, CString strNombre, int nMontante, int nCI)
{
   int nCompare;

   if (dtDate.m_status != COleDateTime::valid) return -1;
   if (m_dtDate < dtDate) return -1;
   if (m_dtDate > dtDate) return 1;

   nCompare = m_strNombre.Compare(strNombre);
   if (nCompare < 0) return -1;
   if (nCompare > 0) return 1;

   if (m_nMontante < nMontante) return -1;
   if (m_nMontante > nMontante) return 1;

   if (m_nCI < nCI) return -1;
   if (m_nCI > nCI) return 1;

   return 0;
}

int CProject1::Compare(CProject1* pTest)
{
   return Compare(pTest->GetDate(), pTest->GetNombre(), pTest->GetMontante(), pTest->GetCI());
}


Proyecto1.h
Código:
///////////////////////////////////////////////////////////////////////////
// CProject1 -- Interface for CProject1 object



#ifndef __PROJECT1_H__
#define __PROJECT1_H__


class CProject1;


class CProject1List : public CObList
{
public:
   CProject1* FindProject1(COleDateTime dtDate, CString strNombre, int nMontante, int nCI);
   POSITION FindProject1Pos(COleDateTime dtDate, CString strNombre, int nMontante, int nCI);
   POSITION FindProject1PosBruteForce(COleDateTime dtDate, CString strNombre, int nMontante, int nCI);
   void AddProject1(CProject1* pNew);
   void RemoveProject1(COleDateTime dtDate, CString strNombre, int nMontante, int nCI);
   virtual void Serialize(CArchive& ar);
   void ClearAndDelete();
};



class CProject1 : public CObject
{
// construction
public:
   DECLARE_SERIAL(CProject1);
   CProject1();
   CProject1(COleDateTime dtDate, CString strNombre, int nMontante, int nCI);
   ~CProject1();

// Attributes
public:



protected:
   COleDateTime m_dtDate;
   CString m_strNombre;
   int m_nMontante;
   int m_nCI;
   CString m_strNombre;
   CString m_strDireccion;
   int m_nCI;
   int m_nMontante;
   CString m_strEstado;
   CString m_strRazon;
   COleDateTime m_dtFecha;
   COleDateTime m_dtCreated;
   COleDateTime m_dtLastModified;


// Operations
public:
   virtual void Serialize(CArchive& ar);
   void Duplicate(CProject1* pSource);
   void Clear();
   int Compare(COleDateTime dtDate, CString strNombre, int nMontante, int nCI);
   int Compare(CProject1* pTest);


// Diagnostics
#ifdef _DEBUG
   void AssertValid() const;
   virtual void Dump(CDumpContext& dc) const;
#endif


// inlines
public:
   inline void SetDate(COleDateTime dtNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_dtDate = dtNew; }
   inline COleDateTime GetDate() {;
      return m_dtDate; }

   inline void SetNombre(CString strNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_strNombre = strNew;
      m_strNombre.FreeExtra(); }
   inline CString GetNombre() {;
      return m_strNombre; }

   inline void SetMontante(int nNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_nMontante = nNew; }
   inline int GetMontante() {;
      return m_nMontante; }

   inline void SetCI(int nNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_nCI = nNew; }
   inline int GetCI() {;
      return m_nCI; }

   inline void SetNombre(CString strNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_strNombre = strNew;
      m_strNombre.FreeExtra(); }
   inline CString GetNombre() {;
      return m_strNombre; }

   inline void SetDireccion(CString strNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_strDireccion = strNew;
      m_strDireccion.FreeExtra(); }
   inline CString GetDireccion() {;
      return m_strDireccion; }

   inline void SetCI(int nNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_nCI = nNew; }
   inline int GetCI() {;
      return m_nCI; }

   inline void SetMontante(int nNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_nMontante = nNew; }
   inline int GetMontante() {;
      return m_nMontante; }

   inline void SetEstado(CString strNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_strEstado = strNew;
      m_strEstado.FreeExtra(); }
   inline CString GetEstado() {;
      return m_strEstado; }

   inline void SetRazon(CString strNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_strRazon = strNew;
      m_strRazon.FreeExtra(); }
   inline CString GetRazon() {;
      return m_strRazon; }

   inline void SetFecha(COleDateTime dtNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_dtFecha = dtNew; }
   inline COleDateTime GetFecha() {;
      return m_dtFecha; }

   inline void SetCreated(COleDateTime dtNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_dtCreated = dtNew; }
   inline COleDateTime GetCreated() {;
      return m_dtCreated; }

   inline void SetLastModified(COleDateTime dtNew) {
      m_dtLastModified = COleDateTime::GetCurrentTime();
      m_dtLastModified = dtNew; }
   inline COleDateTime GetLastModified() {;
      return m_dtLastModified; }



};


#endif // #define __PROJECT1_H__


Buena suerte
Saludos[/code]

_________________
No estoy de acuerdo con lo que usted dice, pero defenderé hasta la muerte su derecho a decirlo. (Voltaire)
Ver perfil de usuario Enviar mensaje privado
gracias
MensajePublicado: Lun Ene 09, 2006 11:06 am Responder citando
carlys_18
Invitado
 




oye gracias por tu ayuda!! ya tengo el codigo practicamente completado pero me esta dando un error en el type iostream y no se a que se deba!!!!

te agradezco si me pudieras contestar.. gracias.
proyect
  Foros de discusión -> Programación
Puede publicar nuevos temas en este foro
No puede responder a temas en este foro
No puede editar sus mensajes en este foro
No puede borrar sus mensajes en este foro
No puede votar en encuestas en este foro
Todas las horas son GMT + 10 Horas  
Página 1 de 1  

  
  
 Publicar nuevo tema  Responder al tema  


Powered by phpBB © 2001-2003 phpBB Group
Theme created by Vjacheslav Trushkin
Forums ©
Theme Design By Aclantis Hosting    Powered By PHP-Nuke

ZaKaTRoN Caratulandia.net Aclantis AclantisAclantis Aclantis
AclantisAclantis AclantisAclantisAclantis Aclantis

Inicio | Top 20 | Articulos | Descargas | Noticias - © (2000 - 2008) - Aclantis by Draving - Contactanos 



[ Script generation time: 0.4225s (PHP: 93% - SQL: 7%) ] - [ SQL queries: 22 ] - [ Pages served in past 5 minutes : 238 ] - [ GZIP disabled ] - [ Debug on ]