Documente Academic
Documente Profesional
Documente Cultură
INTRODUCCIN
Una estructura de datos define la organizacin e interrelacin de estos y un
conjunto de operaciones que se pueden realizar sobre ellos. Las operaciones
bsicas son:
En programacin, una estructura de datos es una forma de organizar un conjunto
de datos elementales con el objetivo de facilitar su manipulacin. Un dato
elemental es la mnima informacin que se tiene en un sistema.
OBJETIVOS
JUSTIFICACIN
ESTRUCTURA DE DATOS
Unidad 1: Memoria dinmica
Fundamentacin Terica
Los apuntadores son la base fundamental para la gestin dinmica de memoria, la
cual hace referencia a la forma en que se almacenan los datos en la computadora
a travs de los operadores y funciones para asignar y liberar memoria. Se tiene en
cuenta los tipos de datos que manejan el lenguaje C++ y el nmero de bytes
requeridos para almacenar cada tipo de datos, pues, son los programadores, los
llamados a optimizar los recursos tanto fsicos como lgicos de un sistema
informtico. Las estructuras de datos lineales influyen directamente con el
manejo de la memoria del computador cuando se implementan las Pilas, Colas y
producto, descripcin del producto, valor del producto y un valor total de las
ventas). De acuerdo a la captura de requerimientos anteriores se plantean los
siguientes requerimientos funcionales:
Requerimientos funcionales
Universidad, nombre del CEAD y el nombre de la aplicacin DISTRIMAXI y los
datos bsicos de quien disea el programa, (cdigo, nombre y grupo), adems de
implementarle la contrasea de ingreso genrica que ser: 123 la cual validar el
ingreso a la aplicacin.
con las tres opciones ya descritas
(Proveedores, Inventario y Ventas).
opciones de Insertar, visualizar, eliminar y salir de Proveedores, al salir lo debe
regresar al men principal.
opciones de Insertar, visualizar, eliminar y salir de inventarios, al salir lo debe
regresar al men principal.
n donde tendr las
opciones de registrar una venta, visualizarla venta, eliminar un producto de la
venta, una opcin para acumular el total de las ventas y la opcin de salir de
ventas, al salir lo debe regresar al men principal.
El desarrollo de este proyecto requiere mucha dedicacin, se hace necesario
investigar un poco acerca del tema manejo de estructuras, memoria dinmica y
apuntadores. Pero lo ms importante por tratarse de un proyecto final de
transferencia donde se debe mostrar sus competencias desarrolladas debe ser un
producto realizado por usted de forma autnoma.
Para facilitar la comprensin de los requerimientos funcionales del programa Se
ha diseado la arquitectura del programa a realizar de forma grfica, de tal
manera que la informacin a registrar p ara este caso est en tres categoras a lo
que podramos llamar mdulos del programa
Descripcin
Archivos de la practica 1 (la carpeta contiene dos tipos de archivos .cpp y .exe)
FECHA[30];
long NIT ;
long VALOR ;
long TOTAL ;
VENTAS *ANT ;
VENTAS *SIG ;
};
VENTAS *CABEZAV, *FINV ;
int PORTADA()
{
int OP ;
textcolor(BLUE);textbackground(WHITE);
clrscr() ;
gotoxy(26,6) ; cout << "UNIVERSIDAD NACIONAL ABIERTA Y A";
gotoxy(36,8); cout << "DISTANCIA" ;
gotoxy(27,14); cout << "SISTEMA DE INFORMACION PARA EL ";
gotoxy(28,16); cout << "REGISTRO DE INVENTARIO DE LA ";
gotoxy(30,18); cout << "DISTRIBUIDORA SUPERMAXI";
gotoxy(35,22); cout << "DISTRIMAXI";
gotoxy(33,26); cout << "DESARROLLADO POR :";
gotoxy(32,28); cout << "DEYANIS MARTINEZ";
do {
gotoxy(22,40); cout << "INGRESE SU CONTRASEA : ";
cin >> OP ;
gotoxy(30,42); cout << "CONTRASEA INCORRECTA";
} while(OP != 123) ;
gotoxy(30,22); clreol();
return OP ;
}
////////////////////// PROVEDORES ////////////////////////////////
void CREAR_PROVEDOR()
{
PROVEDOR *P ;
char OP = 'S';
while (OP == 'S')
{
clrscr();
gotoxy(26,6) ; cout << "DISTRIMAXI";
gotoxy(20,7) ; cout << "INSERTAR PROVEDORES";
gotoxy(20,12); cout <<"NIT
: ";
: ";
if (CABEZA == NULL)
{
gotoxy(22,31); cout << " NO EXISTE LISTA";
OP = 'N'; getch();
}
else
{
clrscr();
gotoxy(32,6) ; cout << "DISTRIMAXI";
gotoxy(30,7) ; cout << "VISUALIZAR PROVEDORES";
gotoxy(32,10) ; cout << "1. POR EL INICIO";
gotoxy(32,11) ; cout << "2. POR EL FINAL ";
gotoxy(32,13) ; cout << "3. SALIR
";
do {
gotoxy(22,16); cout << "SELECIONE UNA DE LAS ALTERNATIVAS : ";
cin >> TIPO;
gotoxy(30,22) ; cout << " Opcion no valida ";
} while((TIPO < 1)|| (TIPO > 3)) ;
gotoxy(30,22) ; clreol();
switch (TIPO) {
case 1 : INICIO = CABEZA;
break;
case 2 : INICIO = FIN;
break ;
case 3 : OP = 'N' ;
}
}
while(( INICIO != NULL) && (OP == 'S'))
{
clrscr() ;
gotoxy(26,6) ; cout << "DISTRIMAXI";
gotoxy(20,7) ; cout << "VISUALIZAR PROVEDORES";
gotoxy(20,12); cout <<"NIT : " << INICIO->NIT;
gotoxy(20,14); cout <<"NOMBRE : " << INICIO->NOMBRE;
gotoxy(20,16); cout <<"DIRECCION : " << INICIO->DIR;
gotoxy(20,18); cout <<"TELEFONO
if (TIPO == 1)
INICIO = INICIO->SIG ;
else
INICIO = INICIO->ANT;
do {
gotoxy(29,24); cout <<"DESEA CONTINUAR S/N : ";
OP = getche();
OP = toupper(OP);
} while((OP != 'S') && (OP != 'N'));
}
}
//////////////////////////// INVENTARIOS //////////////////////
void CREAR_INVENTARIO()
{
INVENTARIO *P ;
char OP = 'S';
while (OP == 'S')
{
clrscr();
gotoxy(26,6) ; cout << "DISTRIMAXI";
gotoxy(20,7) ; cout << "INSERTAR INVENTARIO";
gotoxy(20,12); cout <<"NIT
: ";
P->SIG = NULL ;
P->ANT = NULL ;
if (CABEZAI == NULL)
CABEZAI
=P;
else
{
FINI->SIG = P ;
P->ANT = FINI ;
}
FINI = P;
do {
gotoxy(29,24); cout <<"DESEA CONTINUAR S/N : ";
OP = getche();
OP = toupper(OP);
} while((OP != 'S') && (OP != 'N'));
}
void CONSULTA_INVENTARIO()
{
char OP = 'S' ;
INVENTARIO *INICIO = CABEZAI;
int TIPO ;
if (CABEZAI == NULL)
{
gotoxy(22,31); cout << " NO EXISTE LISTA";
OP = 'N'; getch();
}
else
{
clrscr();
gotoxy(32,6) ; cout << "DISTRIMAXI";
gotoxy(30,7) ; cout << "VISUALIZAR INVENTARIO";
gotoxy(32,10) ; cout << "1. POR EL INICIO";
gotoxy(32,11) ; cout << "2. POR EL FINAL ";
gotoxy(32,13) ; cout << "3. SALIR
";
do {
gotoxy(22,16); cout << "SELECIONE UNA DE LAS ALTERNATIVAS : ";
: ";
: ";
: ";
P = new VENTAS;
if ( P == NULL )
{
gotoxy(25,22); cout << "NO HAY ESPACIO DE MEMORIA PARA ASIGNAR";
getch(); OP = 'N';
}
else
{
do {
gotoxy(38,10); cin >> P->FACTURA ;
gotoxy(30,22); cout << "VALOR FUERA DE RANGO";
} while((P->FACTURA < 0) || (P->FACTURA > 999999999)) ;
gotoxy(30,22); clreol();
gotoxy(38,12); gets(P->NOMBRE_CLIENTE);
gotoxy(38,14); gets(P->FECHA);
gotoxy(38,16); cin>>P->NIT;
gotoxy(38,18); cin>>P->VALOR;
gotoxy(38,20); cin>>P->TOTAL;
gotoxy(30,22); clreol();
P->SIG = NULL ;
P->ANT = NULL ;
if (CABEZAV == NULL)
CABEZAV = P ;
else
{
FINV->SIG = P ;
P->ANT = FINV ;
}
FINV = P;
do {
gotoxy(29,24); cout <<"DESEA CONTINUAR S/N : ";
OP = getche();
OP = toupper(OP);
} while((OP != 'S') && (OP != 'N'));
}
void CONSULTA_VENTAS()
{
char OP = 'S' ;
VENTAS *INICIO = CABEZAV;
int TIPO ;
if (CABEZAV == NULL)
{
gotoxy(22,31); cout << " NO EXISTE LISTA";
OP = 'N'; getch();
}
else
{
clrscr();
gotoxy(32,6) ; cout << "DISTRIMAXI";
gotoxy(30,7) ; cout << "VISUALIZAR VENTAS";
gotoxy(32,10) ; cout << "1. POR EL INICIO";
gotoxy(32,11) ; cout << "2. POR EL FINAL ";
gotoxy(32,13) ; cout << "3. SALIR
";
do {
gotoxy(22,16); cout << "SELECIONE UNA DE LAS ALTERNATIVAS : ";
cin >> TIPO;
gotoxy(30,22) ; cout << " Opcion no valida ";
} while((TIPO < 1)|| (TIPO > 3)) ;
gotoxy(30,22) ; clreol();
switch (TIPO) {
case 1 : INICIO = CABEZAV;
break;
case 2 : INICIO = FINV;
break ;
case 3 : OP = 'N' ;
}
} while(( INICIO != NULL) && (OP == 'S'))
{
clrscr() ;
gotoxy(26,6) ; cout << "DISTRIMAXI";
if (TIPO == 1)
INICIO = INICIO->SIG ;
else
INICIO = INICIO->ANT;
do {
gotoxy(29,24); cout <<"DESEA CONTINUAR S/N : ";
OP = getche();
OP = toupper(OP);
} while((OP != 'S') && (OP != 'N'));
}
////////////////////////// MENU PRINCIPAL //////////////////////////////
void marco(void)
{ int j;
for(j=15;j<=65;j++)
{
gotoxy(j,2);cout<<"=";
gotoxy(j,24);cout<<"=";
void marcop(void)
{ int j;
for(j=15;j<=65;j++)
{
gotoxy(j,2);cout<<"=";
gotoxy(j,24);cout<<"=";
}
}
void main(void)
{
char CONTROL = 'S';
int OPCION,OPC ;
CABEZA = NULL ;
OPCION = PORTADA();
if (OPCION ==123){
while ( CONTROL == 'S')
{
clrscr();
marco();
gotoxy(34,6) ; cout << "DISTRIMAXI";
gotoxy(32,8) ; cout << "MENU PRIMCIPAL";
gotoxy(32,10) ; cout << "[1]-PROVEEDORES";
gotoxy(32,12) ; cout << "[2]-INVENTARIOS ";
gotoxy(32,14) ; cout << "[3]-VENTAS
gotoxy(32,16) ; cout << "[4]-SALIR
do
";
";
";
";
do {
gotoxy(22,20); cout << "SELECIONE UNA DE LAS ALTERNATIVAS : ";
cin >> OP;
gotoxy(30,22) ; cout << " Opcion no valida ";
} while((OP < 1) || (OP > 4)) ;
switch (OP) {
case 1 ://CREAR_PROVEDOR();
break;
case 2://CONSULTA_PROVEDOR();
break;
case 3 :
break;
case 4 : CONTROL_P = 'N';
}
}
break;
case 2 :
int OPI ;
char CONTROL_I='S';
while ( CONTROL_I == 'S')
{
clrscr();
marco();
gotoxy(36,6) ; cout << "DISTRIMAXI";
gotoxy(32,8) ; cout << "ADMINISTRAR INVENTARIOS";
gotoxy(30,10) ; cout << "[1]-INGRESAR INVENTARIO";
gotoxy(30,12) ; cout << "[2]-VISUALIZAR INVENTARIO
";
";
";
do {
gotoxy(22,20); cout << "SELECIONE UNA DE LAS ALTERNATIVAS : ";
cin >> OPI;
gotoxy(30,22) ; cout << " Opcion no valida ";
} while((OPI < 1) || (OPI > 4)) ;
switch (OPI) {
case 1 ://CREAR_INVENTARIO();
break;
case 2://CONSULTA_INVENTARIO();
break;
case 3 :
break;
case 4 : CONTROL_I = 'N';
}
}
break;
case 3 :
int OPVEN ;
char CONTROL_V='S';
while ( CONTROL_V == 'S')
{
clrscr();
marco();
gotoxy(36,6) ; cout << "DISTRIMAXI";
gotoxy(32,8) ; cout << "ADMINISTRAR VENTAS";
gotoxy(30,10) ; cout << "[1]-INGRESAR VENTAS";
gotoxy(30,12) ; cout << "[2]-VISUALIZAR VENTAS";
gotoxy(30,14) ; cout << "[3]-ELIMINAR VENTAS";
gotoxy(30,16) ; cout << "[4]-VOLVER AL MENU PRINCIPAL
";
do {
gotoxy(22,20); cout << "SELECIONE UNA DE LAS ALTERNATIVAS : ";
cin >> OP;
gotoxy(30,22) ; cout << " Opcion no valida ";
} while((OP < 1) || (OP > 4)) ;
switch (OP) {
case 1 ://CREAR_VENTA();
break;
case 2://CONSULTA_VENTAS();
break;
case 3 :
break;
case 4 : CONTROL_V = 'N';
break;
case 4 : CONTROL = 'N';
PRACTICA No. 2 APLICACIN A LAS ESTRUCTURAS DE DATOS LINEALES
Descripcin de la prctica
En la prctica No1 se realiz la interfaz inicial del proyecto, se identificaron los
requerimientos generales y funcionales y se implement el men principal y el
men para el mdulo de administrar Proveedores se compil y se depur el
programa.
La ltima opcin numero 4 se refiere al fin del submen de ventas para ir al men
principal
Cdigo fuente
#include <iostream.h>
#include <conio.h>
#include <ctype.h>
#include <stdio.h>
void marco();
struct PROVEDOR {
long NIT ;
char NOMBRE[30];
char DIR[20];
long TELEFONO ;
PROVEDOR *ANT ;
PROVEDOR *SIG ;
};
PROVEDOR *CABEZA, *FIN ;
/////////////////// INVENTARIOS //////////
struct INVENTARIO {
long NIT ;
char NOMBRE[30];
long VALOR ;
INVENTARIO *ANT ;
INVENTARIO *SIG ;
};
INVENTARIO *CABEZAI, *FINI ;
///////////////// VENTAS /////////////////
struct VENTAS {
long FACTURA ;
char NOMBRE_CLIENTE[30];
char
FECHA[30];
long NIT ;
long VALOR ;
long TOTAL ;
VENTAS *ANT ;
VENTAS *SIG ;
};
VENTAS *CABEZAV, *FINV ;
int PORTADA()
{
int OP ;
textcolor(BLUE);textbackground(WHITE);
clrscr()
gotoxy(26,6) ; cout << "UNIVERSIDAD NACIONAL ABIERTA Y A";
gotoxy(36,8); cout << "DISTANCIA" ;
gotoxy(27,14); cout << "SISTEMA DE INFORMACION PARA EL ";
gotoxy(28,16); cout << "REGISTRO DE INVENTARIO DE LA ";
gotoxy(30,18); cout << "DISTRIBUIDORA SUPERMAXI";
gotoxy(35,22); cout << "DISTRIMAXI";
gotoxy(33,26); cout << "DESARROLLADO POR :";
gotoxy(32,28); cout << "DEYANIS MARTINEZ";
do {
gotoxy(22,40); cout << "INGRESE SU CONTRASEA : ";
cin >> OP ;
gotoxy(30,42); cout << "CONTRASEA INCORRECTA";
} while(OP != 123) ;
gotoxy(30,22); clreol();
return OP ;
}
////////////////////// PROVEDORES ////////////////////////////////
void CREAR_PROVEDOR()
{
PROVEDOR *P ;
char OP = 'S';
while (OP == 'S')
{
clrscr();
gotoxy(26,6) ; cout << "DISTRIMAXI";
gotoxy(20,7) ; cout << "INSERTAR PROVEDORES";
gotoxy(20,12); cout <<"NIT
: ";
: ";
else
{
do {
gotoxy(34,12); cin >> P->NIT ;
gotoxy(30,22); cout << "VALOR FUERA DE RANGO";
} while((P->NIT < 0) || (P->NIT > 999999999)) ;
gotoxy(30,22); clreol();
gotoxy(34,14); gets(P->NOMBRE);
gotoxy(34,16); gets(P->DIR);
gotoxy(30,22); clreol();
gotoxy(34,18); cin >> P->TELEFONO ;
P->SIG = NULL ;
P->ANT = NULL ;
if (CABEZA == NULL)
CABEZA = P ;
else
{
FIN->SIG = P ;
P->ANT = FIN ;
}
FIN = P;
do {
gotoxy(29,24); cout <<"DESEA CONTINUAR S/N : ";
OP = getche();
OP = toupper(OP);
} while((OP != 'S') && (OP != 'N'));
}
}
}
void CONSULTA_PROVEDOR()
{
char OP = 'S' ;
PROVEDOR *INICIO = CABEZA;
int TIPO ;
if (CABEZA == NULL)
{
gotoxy(22,31); cout << " NO EXISTE LISTA";
OP = 'N'; getch();
}
else
{
clrscr();
gotoxy(32,6) ; cout << "DISTRIMAXI";
gotoxy(30,7) ; cout << "VISUALIZAR PROVEDORES";
gotoxy(32,10) ; cout << "1. POR EL INICIO";
gotoxy(32,11) ; cout << "2. POR EL FINAL ";
gotoxy(32,13) ; cout << "3. SALIR
";
do {
gotoxy(22,16); cout << "SELECIONE UNA DE LAS ALTERNATIVAS : ";
cin >> TIPO;
gotoxy(30,22) ; cout << " Opcion no valida ";
} while((TIPO < 1)|| (TIPO > 3)) ;
gotoxy(30,22) ; clreol();
switch (TIPO) {
case 1 : INICIO = CABEZA;
break;
case 2 : INICIO = FIN;
break ;
case 3 : OP = 'N' ;
}
}
while(( INICIO != NULL) && (OP == 'S'))
{
clrscr() ;
gotoxy(26,6) ; cout << "DISTRIMAXI";
gotoxy(20,7) ; cout << "VISUALIZAR PROVEDORES";
gotoxy(20,12); cout <<"NIT : " << INICIO->NIT;
gotoxy(20,14); cout <<"NOMBRE : " << INICIO->NOMBRE;
gotoxy(20,16); cout <<"DIRECCION : " << INICIO->DIR;
gotoxy(20,18); cout <<"TELEFONO
if (TIPO == 1)
INICIO = INICIO->SIG ;
else
INICIO = INICIO->ANT;
do {
gotoxy(29,24); cout <<"DESEA CONTINUAR S/N : ";
OP = getche();
OP = toupper(OP);
} while((OP != 'S') && (OP != 'N'));
}
}
//////////////////////////// INVENTARIOS //////////////////////
void CREAR_INVENTARIO()
{
INVENTARIO *P ;
char OP = 'S';
while (OP == 'S')
{
clrscr();
gotoxy(26,6) ; cout << "DISTRIMAXI";
gotoxy(20,7) ; cout << "INSERTAR INVENTARIO";
gotoxy(20,12); cout <<"NIT
: ";
if (CABEZAI == NULL)
CABEZAI
=P;
else
{
FINI->SIG = P ;
P->ANT = FINI ;
}
FINI = P;
do {
gotoxy(29,24); cout <<"DESEA CONTINUAR S/N : ";
OP = getche();
OP = toupper(OP);
} while((OP != 'S') && (OP != 'N'));
}
}
}
void CONSULTA_INVENTARIO()
{
char OP = 'S' ;
INVENTARIO *INICIO = CABEZAI;
int TIPO ;
if (CABEZAI == NULL)
{
gotoxy(22,31); cout << " NO EXISTE LISTA";
OP = 'N'; getch();
}
else
{
clrscr();
gotoxy(32,6) ; cout << "DISTRIMAXI";
gotoxy(30,7) ; cout << "VISUALIZAR INVENTARIO";
gotoxy(32,10) ; cout << "1. POR EL INICIO";
gotoxy(32,11) ; cout << "2. POR EL FINAL ";
gotoxy(32,13) ; cout << "3. SALIR
";
do {
gotoxy(22,16); cout << "SELECIONE UNA DE LAS ALTERNATIVAS : ";
cin >> TIPO;
gotoxy(30,22) ; cout << " Opcion no valida ";
: ";
: ";
: ";
P = new VENTAS;
if ( P == NULL )
{
gotoxy(25,22); cout << "NO HAY ESPACIO DE MEMORIA PARA ASIGNAR";
getch(); OP = 'N';
}
else
{
do {
gotoxy(38,10); cin >> P->FACTURA ;
gotoxy(30,22); cout << "VALOR FUERA DE RANGO";
} while((P->FACTURA < 0) || (P->FACTURA > 999999999)) ;
gotoxy(30,22); clreol();
gotoxy(38,12); gets(P->NOMBRE_CLIENTE);
gotoxy(38,14); gets(P->FECHA);
gotoxy(38,16); cin>>P->NIT;
gotoxy(38,18); cin>>P->VALOR;
gotoxy(38,20); cin>>P->TOTAL;
gotoxy(30,22); clreol();
P->SIG = NULL ;
P->ANT = NULL ;
if (CABEZAV == NULL)
CABEZAV = P ;
else
{
FINV->SIG = P ;
P->ANT = FINV ;
}
FINV = P;
do {
gotoxy(29,24); cout <<"DESEA CONTINUAR S/N : ";
OP = getche();
OP = toupper(OP);
";
do {
gotoxy(22,16); cout << "SELECIONE UNA DE LAS ALTERNATIVAS : ";
cin >> TIPO;
gotoxy(30,22) ; cout << " Opcion no valida ";
} while((TIPO < 1)|| (TIPO > 3)) ;
gotoxy(30,22) ; clreol();
switch (TIPO) {
case 1 : INICIO = CABEZAV;
break;
case 2 : INICIO = FINV;
break ;
case 3 : OP = 'N' ;
while(( INICIO != NULL) && (OP == 'S'))
{
clrscr() ;
gotoxy(26,6) ; cout << "DISTRIMAXI";
if (TIPO == 1)
INICIO = INICIO->SIG ;
else
INICIO = INICIO->ANT;
do {
gotoxy(29,24); cout <<"DESEA CONTINUAR S/N : ";
OP = getche();
OP = toupper(OP);
} while((OP != 'S') && (OP != 'N'));
}
}
////////////////////////// MENU PRINCIPAL /////////////////////////////
void marco(void)
{ int j;
for(j=15;j<=65;j++)
{
gotoxy(j,2);cout<<"=";
gotoxy(j,24);cout<<"=";
}
void marcop(void)
{ int j;
for(j=15;j<=65;j++)
{
gotoxy(j,2);cout<<"=";
gotoxy(j,24);cout<<"=";
}
}
void main(void)
{
char CONTROL = 'S';
int OPCION,OPC ;
CABEZA = NULL ;
OPCION = PORTADA();
if (OPCION ==123){
while ( CONTROL == 'S')
{
clrscr();
marco();
gotoxy(34,6) ; cout << "DISTRIMAXI";
gotoxy(32,8) ; cout << "MENU PRIMCIPAL";
gotoxy(32,10) ; cout << "[1]-PROVEEDORES";
gotoxy(32,12) ; cout << "[2]-INVENTARIOS ";
gotoxy(32,14) ; cout << "[3]-VENTAS
gotoxy(32,16) ; cout << "[4]-SALIR
do
";
";
";
";
do {
gotoxy(22,20); cout << "SELECIONE UNA DE LAS ALTERNATIVAS : ";
cin >> OP;
gotoxy(30,22) ; cout << " Opcion no valida ";
} while((OP < 1) || (OP > 4)) ;
switch (OP) {
case 1 :CREAR_PROVEDOR();
break;
case 2:CONSULTA_PROVEDOR();
break;
case 3 :
break;
case 4 : CONTROL_P = 'N';
}
}
break;
case 2 :
int OPI ;
char CONTROL_I='S';
while ( CONTROL_I == 'S')
{
clrscr();
marco();
gotoxy(36,6) ; cout << "DISTRIMAXI";
gotoxy(32,8) ; cout << "ADMINISTRAR INVENTARIOS";
gotoxy(30,10) ; cout << "[1]-INGRESAR INVENTARIO";
gotoxy(30,12) ; cout << "[2]-VISUALIZAR INVENTARIO
";
";
";
do {
gotoxy(22,20); cout << "SELECIONE UNA DE LAS ALTERNATIVAS : ";
cin >> OPI;
gotoxy(30,22) ; cout << " Opcion no valida ";
} while((OPI < 1) || (OPI > 4)) ;
switch (OPI) {
case 1 :CREAR_INVENTARIO();
break;
case 2:CONSULTA_INVENTARIO();
break;
case 3 :
break;
case 4 : CONTROL_I = 'N';
}
}
break;
case 3 :
int OPVEN ;
char CONTROL_V='S';
while ( CONTROL_V == 'S')
{
clrscr();
marco();
gotoxy(36,6) ; cout << "DISTRIMAXI";
gotoxy(32,8) ; cout << "ADMINISTRAR VENTAS";
gotoxy(30,10) ; cout << "[1]-INGRESAR VENTAS";
gotoxy(30,12) ; cout << "[2]-VISUALIZAR VENTAS";
gotoxy(30,14) ; cout << "[3]-ELIMINAR VENTAS";
gotoxy(30,16) ; cout << "[4]-VOLVER AL MENU PRINCIPAL
";
do {
gotoxy(22,20); cout << "SELECIONE UNA DE LAS ALTERNATIVAS :
cin >> OP;
gotoxy(30,22) ; cout << " Opcion no valida ";
} while((OP < 1) || (OP > 4)) ;
switch (OP) {
case 1 :CREAR_VENTA();
break;
case 2:CONSULTA_VENTAS();
break;
case 3 :
break;
case 4 : CONTROL_V = 'N';
}
}
break;
case 4 : CONTROL = 'N'
PRACTICA No. 3 APLICACIN AL MODO GRAFICO DE C++
Descripcin de la prctica
Cdigo fuente
#include<stdio.h>
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<math.h>
#include<ctype.h>
#include<string.h>
#include<graphics.h>
#include <interfac.h>
#include <arbol.h>
void marco(){
int j,i;
for(j=15;j<=65;j++)
{
gotoxy(j,2);cout<<"=";
gotoxy(j,24);cout<<"=";
}
for(i=2;i<=24;i++)
{
gotoxy(15,i);cout<<"=";
gotoxy(65,i);cout<<"=";
}
}
void main(void){
int gdriver = DETECT, gmode;
int elemento, valor, opcion, i;
char *dato;
NODOARBOL *raiz=NULL;
clrscr();
for(;;){
nuevo:
opcion=menu();
if((opcion>=10 && opcion<=16) && raiz==NULL){
window(52,8,80,12);
textattr(YELLOW + BLINK);
textbackground(BLACK);
cprintf("\n\r n\r No hay nodos \n\r en el rbol ");
window(1,1,80,25);
getch(); continue;
}
switch(opcion){
case 6:
clrscr() ;
textcolor(BLUE);textbackground(WHITE);
marco();
gotoxy(26,6) ; cout << "UNIVERSIDAD NACIONAL ABIERTA Y A";
gotoxy(36,8); cout << "DISTANCIA" ;
gotoxy(18,12); cout << "NOMBRE DEL PROGRAMA:INGENIERIA DE SISTEMAS ";
gotoxy(18,14); cout << "PRESENTADO A:HERMES MOSQUERA ";
gotoxy(18,16); cout << "DESARROLLADO POR:DEYANIS MARTINEZ";
gotoxy(18,18); cout << "FECHA DE PRESENTACION: 17/11/2012";
getch();
break;
case 8:
clrscr();
marco();
gotoxy(26,6) ; cout << "UNIVERSIDAD NACIONAL ABIERTA Y A";
cleardevice();
closegraph();
break;
case 18: exit(0);
CONCLUSIN