1 OPERACIONES CON LISTAS SIMPLES
PROGRAMA PARA DESARROLLAR OPERACIONES CON LISTAS SIMPLES
1. DISEÑO DEL FORMULARIO
2. VENTANA DE PROPIEDADES
OBJETO
PROPIEDAD
VALOR
ListBox1
textBox1
textBox2buttom1
buttom2
buttom3
buttom4
buttom5
buttom6
Name
Text
Name
Text
Name
Text
Name
Text
Name
Text
Name
Text
Name
Text
Name
Text
Name
lstLISTA
textELEMENTO
textNUEVOELEMENTO
&AGREGAR
btnAGREGAR
&EDITAR
btnEDITAR
&ELIMINAR
btnrhyELIMINAR
&BUSCAR
BtnBUSAR
&MOSTRAR
BtnMOSTRAR
&SALIR
btnSALIR
3. IMPLEMENTACION DE LAS CLASES
Seleccione las opcionesdel menú principal:
Menú Principal -> Proyecto -> Agregar Clase
Aparecerá la siguiente ventana:
Hagamos doble clic en el objeto: Clase de C++, entonces veremos:3.1 CREACIÓN DE LA CLASE ESTRUCTURA: EstructuraLista
En la ventana anterior, escribiremos en Nombre de Clase: EstructuraLista y activaremos la opción check InLine.
Clic en Finalizar, entoncesveremos:
Definición de la Clase Estructura:
class EstructuraLista
{
public:
char dato;
int ptr;
EstructuraLista(void)
{
}
};
3.2 CREACIÓN DE LA CLASE PROCESO: OperaLista
Aligual que en el caso anterior; crear la clase y colocar en Nombre de Clase: OperaLista
El código de la Clase, es:
#pragma once
#include "EstructuraLista.h"
class OperaLista
{
public:
int CAB;
intLIB;
EstructuraLista L[50];
public:
void Inicializar(EstructuraLista[], int&, int&);
void Agregar(EstructuraLista[], int&, int&, char);
int Buscar(EstructuraLista[], int, int, char, int);
voidEliminar(EstructuraLista[], int&, int&, char);
void Editar(EstructuraLista[], int, int, char, char);
OperaLista(void)
{
}
};
void OperaLista::Inicializar(EstructuraLista L[], int &cab, int &lib)
{cab=99;
lib=0;
for(int k=0; k<50; k++)
{
L[k].dato=' ';
L[k].ptr=k+1;
}
L[49].ptr = 99;
}
void OperaLista::Agregar(EstructuraLista L[], int &cab, int &lib, char xdato)
{
L[lib].dato =...
Regístrate para leer el documento completo.