En este ejercicio, se pide Crear un menú que muestre 5 circuitos integrados, para que posteriormente, al seleccionar una de las opciones se despliegue los datos del CI seleccionado.
Se emplea el comando System("sleep"), para que el programa haga una pausa, el tiempo varia segun haya sido establecido.
Se utiliza el comando gotoxy para posicionarse en cualquier punto de la pantalla.
los comandos texcolor y system("color") se emplean para cambiar el color por defecto del fondo y del texto.
Printf("%c -----"), se utiliza para imprimir en pantalla simbolos y cáracteres especiales.
Este es un Ejemplo de Ello:
# include <stdio.h>
# include <iostream.h>
# include <windows>
# include <dos.h>
/*
F idel Alvarado Quezada
Mecatronica 2ª C
Goto XY
// BLUE MAGENTA YELLOW RED GREEN BLACK WHITE BROWN
*/
char respuesta;
int opcion, x, y;
void main ()
{
do
{
clrscr();
gotoxy(10,2);
//textcolor(GREEN);
system("color 3f");
//cprintf("**************************** U T V M ****************************");
cout <<"**************************** U T V M ****************************";
//textcolor(RED);
gotoxy(23,4);
//textcolor(GREEN);
//cprintf("************* Menu de CI *************");
cout <<"************* Menu de CI *************";
gotoxy(15,7);
//textcolor(WHITE);
//cprintf("1. AND\n\n2. OR\n\n3. NOT\n\n4. XOR\n\n5. NAND\n\n6. SALIR\n\n");
cout <<"1. AND";
gotoxy(20,9);
cout <<"2. OR";
gotoxy(25,11);
cout <<"3. NOT";
gotoxy(30,13);
cout <<"4. XOR";
gotoxy(35,15);
cout <<"5. NAND";
gotoxy(40,17);
cout <<"6. SALIR";
gotoxy(2,19);
cout <<"Elige: ";
cin>>opcion;
switch(opcion)
{
case 1: clrscr();
gotoxy(30,10);
cprintf("espere por favor");
sleep(1);
cprintf(".");
sleep(1);
cprintf(".");
sleep(1);
cprintf(".");
sleep(1);
clrscr();
system("color 4f");
/*gotoxy(5,5);
//textcolor(GREEN);
//cprintf("TABLA DE VERDAD === AND ===");
cout <<"TABLA DE VERDAD === AND ===";
gotoxy(5,7);
cout<<"a"<<endl;
gotoxy(7,7);
cout<<"b"<<endl;
gotoxy(9,7);
cout<<"s"<<endl;
gotoxy(5,9);
cout<<"0"<<endl;
gotoxy(7,9);
cout<<"0"<<endl;
gotoxy(9,9);
cout<<"0"<<endl;
gotoxy(5,11);
cout<<"0"<<endl;
gotoxy(7,11);
cout<<"1"<<endl;
gotoxy(9,11);
cout<<"0"<<endl;
gotoxy(5,13);
cout<<"1"<<endl;
gotoxy(7,13);
cout<<"0"<<endl;
gotoxy(9,13);
cout<<"0"<<endl;
gotoxy(5,15);
cout<<"1"<<endl;
gotoxy(7,15);
cout<<"1"<<endl;
gotoxy(9,15);
cout<<"1"<<endl;
gotoxy(5,17);
cout<<"s=a*b"<<endl;
gotoxy(5,19);
cout<<"Quieres ver otras opciones < s/n>: ";
cin>>respuesta;*/
//AND
// Lineas H *********************************************
for(x=51;x<=64;x++)
{ gotoxy(x,5);
printf("%c",196);
gotoxy(x,11);
printf("%c",196);}
for(x=45;x<50;x++)
{ gotoxy(x,6);
printf("%c",196);
gotoxy(x,10);
printf("%c",196);}
for(x=66;x<=70;x++)
{ gotoxy(x,8);
printf("%c",196);}
//lineas V********************************************************************************************************
for(y=6;y<=10;y++)
{ gotoxy(50,y);
printf("%c",179);
gotoxy(65,y);
printf("%c",179);}
//conectores ****************************************************************************************************************************************************
gotoxy(50,5);
printf("%c",218);
gotoxy(65,5);
printf("%c",191);
gotoxy(50,11);
printf("%c",192);
gotoxy(65,11);
printf("%c",217);
gotoxy(50,6);
printf("%c",180);
gotoxy(50,10);
printf("%c",180);
gotoxy(65,8);
printf("%c",195);
//tabla OR ***************************************************************************************************************************************************
//lineas horizontales
for(x=5;x<=22;x++)
{ gotoxy(x,7);
printf("%c",196);
gotoxy(x,9);
printf("%c",196);
gotoxy(x,11);
printf("%c",196);
gotoxy(x,13);
printf("%c",196);
gotoxy(x,15);
printf("%c",196);
gotoxy(x,17);
printf("%c",196);
gotoxy(x,19);
printf("%c",196);}
//lineas verticales ********************************************************************************************************************************************
for(y=8;y<=18;y++)
{ gotoxy(5,y);
printf("%c",179);
gotoxy(22,y);
printf("%c",179);
gotoxy(13,y);
printf("%c",179);
gotoxy(9,y);
printf("%c",179);}
//conectores ***************************************************************************************************************************************************
gotoxy(5,7);
printf("%c",218);
gotoxy(22,7);
printf("%c",191);
gotoxy(5,19);
printf("%c",192);
gotoxy(22,19);
printf("%c",217);
gotoxy(5,9);
printf("%c",195);
gotoxy(5,11);
printf("%c",195);
gotoxy(5,13);
printf("%c",195);
gotoxy(5,15);
printf("%c",195);
gotoxy(5,17);
printf("%c",195);
gotoxy(22,9);
printf("%c",180);
gotoxy(22,11);
printf("%c",180);
gotoxy(22,13);
printf("%c",180);
gotoxy(22,15);
printf("%c",180);
gotoxy(22,17);
printf("%c",180);
gotoxy(9,9);
printf("%c",197);
gotoxy(13,7);
printf("%c",194);
gotoxy(9,19);
printf("%c",193);
gotoxy(13,19);
printf("%c",193);
gotoxy(9,7);
printf("%c",194);
gotoxy(9,11);
printf("%c",197);
gotoxy(9,13);
printf("%c",197);
gotoxy(9,15);
printf("%c",197);
gotoxy(9,17);
printf("%c",197);
gotoxy(13,9);
printf("%c",197);
gotoxy(13,11);
printf("%c",197);
gotoxy(13,13);
printf("%c",197);
gotoxy(13,15);
printf("%c",197);
gotoxy(13,17);
printf("%c",197);
//las letras ******************************************************************************************************************************************************
//tabla de verdad
//textcolor(CYAN);
gotoxy(5,3);
printf("TABLA DE VERDAD == AND ==");
//textcolor(GREEN);
gotoxy(7,8);
printf("A");
gotoxy(11,8);
printf("B");
//textcolor(RED);
gotoxy(15,8);
printf("SALIDA");
//valor 1 *******************************************************************************************************************
gotoxy(7,10);
printf("0");
gotoxy(11,10);
printf("0");
gotoxy(18,10);
printf("0");
//valor 2 ************************************************************************************************************************************************
gotoxy(7,12);
printf("0");
gotoxy(11,12);
printf("1");
gotoxy(18,12);
printf("0");
//valor 3 ****************************************************************************************************************************************************
gotoxy(7,14);
printf("1");
gotoxy(11,14);
printf("0");
gotoxy(18,14);
printf("0");
//valor 4 *********************************************************************************************************************************************************
gotoxy(7,16);
printf("1");
gotoxy(11,16);
printf("1");
gotoxy(18,16);
printf("1");
//indicadores*****************************************************************************************************************************************************
gotoxy(47,5);
printf("A");
gotoxy(47,11);
printf("B");
gotoxy(72,8);
printf("S=A.B");
gotoxy(57,8);
printf("AND");
gotoxy(55,14);
printf("=DIAGRAMA=");
//Pregunta*********************************************************************************************
gotoxy(5,21);
cout<<"Desea elegir alguna otra opcion <s/n> ";
cin>>respuesta;
break;
case 2: clrscr();
gotoxy(30,10);
/*cout <<"espere por favor";
sleep(1);
cout <<".";
sleep(1);
cout <<".";
sleep(1);
cout <<".";
sleep(1);*/
cprintf("espere por favor");
sleep(1);
cprintf(".");
sleep(1);
cprintf(".");
sleep(1);
cprintf(".");
sleep(1);
clrscr();
system("color 5f");
//OR
// Lineas H *********************************************
for(x=51;x<=64;x++)
{ gotoxy(x,5);
printf("%c",196);
gotoxy(x,11);
printf("%c",196);}
for(x=45;x<50;x++)
{ gotoxy(x,6);
printf("%c",196);
gotoxy(x,10);
printf("%c",196);}
for(x=66;x<=70;x++)
{ gotoxy(x,8);
printf("%c",196);}
//lineas V********************************************************************************************************
for(y=6;y<=10;y++)
{ gotoxy(50,y);
printf("%c",179);
gotoxy(65,y);
printf("%c",179);}
//conectores ****************************************************************************************************************************************************
gotoxy(50,5);
printf("%c",218);
gotoxy(65,5);
printf("%c",191);
gotoxy(50,11);
printf("%c",192);
gotoxy(65,11);
printf("%c",217);
gotoxy(50,6);
printf("%c",180);
gotoxy(50,10);
printf("%c",180);
gotoxy(65,8);
printf("%c",195);
//tabla OR ***************************************************************************************************************************************************
//lineas horizontales
for(x=5;x<=22;x++)
{ gotoxy(x,7);
printf("%c",196);
gotoxy(x,9);
printf("%c",196);
gotoxy(x,11);
printf("%c",196);
gotoxy(x,13);
printf("%c",196);
gotoxy(x,15);
printf("%c",196);
gotoxy(x,17);
printf("%c",196);
gotoxy(x,19);
printf("%c",196);}
//lineas verticales ********************************************************************************************************************************************
for(y=8;y<=18;y++)
{ gotoxy(5,y);
printf("%c",179);
gotoxy(22,y);
printf("%c",179);
gotoxy(13,y);
printf("%c",179);
gotoxy(9,y);
printf("%c",179);}
//conectores ***************************************************************************************************************************************************
gotoxy(5,7);
printf("%c",218);
gotoxy(22,7);
printf("%c",191);
gotoxy(5,19);
printf("%c",192);
gotoxy(22,19);
printf("%c",217);
gotoxy(5,9);
printf("%c",195);
gotoxy(5,11);
printf("%c",195);
gotoxy(5,13);
printf("%c",195);
gotoxy(5,15);
printf("%c",195);
gotoxy(5,17);
printf("%c",195);
gotoxy(22,9);
printf("%c",180);
gotoxy(22,11);
printf("%c",180);
gotoxy(22,13);
printf("%c",180);
gotoxy(22,15);
printf("%c",180);
gotoxy(22,17);
printf("%c",180);
gotoxy(9,9);
printf("%c",197);
gotoxy(13,7);
printf("%c",194);
gotoxy(9,19);
printf("%c",193);
gotoxy(13,19);
printf("%c",193);
gotoxy(9,7);
printf("%c",194);
gotoxy(9,11);
printf("%c",197);
gotoxy(9,13);
printf("%c",197);
gotoxy(9,15);
printf("%c",197);
gotoxy(9,17);
printf("%c",197);
gotoxy(13,9);
printf("%c",197);
gotoxy(13,11);
printf("%c",197);
gotoxy(13,13);
printf("%c",197);
gotoxy(13,15);
printf("%c",197);
gotoxy(13,17);
printf("%c",197);
//las letras ******************************************************************************************************************************************************
//tabla de verdad
//textcolor(CYAN);
gotoxy(5,3);
printf("TABLA DE VERDAD == OR ==");
//textcolor(GREEN);
gotoxy(7,8);
printf("A");
gotoxy(11,8);
printf("B");
//textcolor(RED);
gotoxy(15,8);
printf("SALIDA");
//valor 1 *******************************************************************************************************************
gotoxy(7,10);
printf("0");
gotoxy(11,10);
printf("0");
gotoxy(18,10);
printf("0");
//valor 2 ************************************************************************************************************************************************
gotoxy(7,12);
printf("0");
gotoxy(11,12);
printf("1");
gotoxy(18,12);
printf("1");
//valor 3 ****************************************************************************************************************************************************
gotoxy(7,14);
printf("1");
gotoxy(11,14);
printf("0");
gotoxy(18,14);
printf("1");
//valor 4 *********************************************************************************************************************************************************
gotoxy(7,16);
printf("1");
gotoxy(11,16);
printf("1");
gotoxy(18,16);
printf("1");
//indicadores*****************************************************************************************************************************************************
gotoxy(47,5);
printf("A");
gotoxy(47,11);
printf("B");
gotoxy(72,8);
printf("S=A+B");
gotoxy(57,8);
printf("OR");
gotoxy(55,14);
printf("=DIAGRAMA=");
//Pregunta*********************************************************************************************
gotoxy(5,21);
cout<<"Desea elegir alguna otra opcion <s/n> ";
cin>>respuesta;
break;
case 3:
clrscr();
gotoxy(30,10);
cprintf("espere por favor");
sleep(1);
cprintf(".");
sleep(1);
cprintf(".");
sleep(1);
cprintf(".");
sleep(1);
clrscr();
system("color 9f");
gotoxy(5,5);
//textcolor(GREEN);
//cprintf("TABLA DE VERDAD === NOT ===");
//cout <<"TABLA DE VERDAD === NOT ===";
/*gotoxy(5,7);
cout<<"a"<<endl;
gotoxy(7,7);
cout<<"b"<<endl;
gotoxy(5,9);
cout<<"0"<<endl;
gotoxy(7,9);
cout<<"1"<<endl;
gotoxy(5,11);
cout<<"1"<<endl;
gotoxy(7,11);
cout<<"0"<<endl;
gotoxy(5,13);
cout<<"s=a"<<endl;
gotoxy(5,19);
cout<<"Quieres ver otras opciones < s/n>: ";
cin>>respuesta;*/
// Lineas H *********************************************
for(x=51;x<=64;x++)
{ gotoxy(x,5);
printf("%c",196);
gotoxy(x,11);
printf("%c",196);}
for(x=45;x<50;x++)
{ gotoxy(x,6);
printf("%c",196);
gotoxy(x,10);
printf("%c",196);}
for(x=66;x<=70;x++)
{ gotoxy(x,8);
printf("%c",196);}
//lineas V********************************************************************************************************
for(y=6;y<=10;y++)
{ gotoxy(50,y);
printf("%c",179);
gotoxy(65,y);
printf("%c",179);}
//conectores ****************************************************************************************************************************************************
gotoxy(50,5);
printf("%c",218);
gotoxy(65,5);
printf("%c",191);
gotoxy(50,11);
printf("%c",192);
gotoxy(65,11);
printf("%c",217);
gotoxy(50,6);
printf("%c",180);
gotoxy(50,10);
printf("%c",180);
gotoxy(65,8);
printf("%c",195);
//tabla OR ***************************************************************************************************************************************************
//lineas horizontales
for(x=5;x<=22;x++)
{ gotoxy(x,7);
printf("%c",196);
gotoxy(x,9);
printf("%c",196);
gotoxy(x,11);
printf("%c",196);
gotoxy(x,13);
printf("%c",196);
gotoxy(x,15);
printf("%c",196);
gotoxy(x,17);
printf("%c",196);
gotoxy(x,19);
printf("%c",196);}
//lineas verticales ********************************************************************************************************************************************
for(y=8;y<=18;y++)
{ gotoxy(5,y);
printf("%c",179);
gotoxy(22,y);
printf("%c",179);
gotoxy(13,y);
printf("%c",179);
gotoxy(9,y);
printf("%c",179);}
//conectores ***************************************************************************************************************************************************
gotoxy(5,7);
printf("%c",218);
gotoxy(22,7);
printf("%c",191);
gotoxy(5,19);
printf("%c",192);
gotoxy(22,19);
printf("%c",217);
gotoxy(5,9);
printf("%c",195);
gotoxy(5,11);
printf("%c",195);
gotoxy(5,13);
printf("%c",195);
gotoxy(5,15);
printf("%c",195);
gotoxy(5,17);
printf("%c",195);
gotoxy(22,9);
printf("%c",180);
gotoxy(22,11);
printf("%c",180);
gotoxy(22,13);
printf("%c",180);
gotoxy(22,15);
printf("%c",180);
gotoxy(22,17);
printf("%c",180);
gotoxy(9,9);
printf("%c",197);
gotoxy(13,7);
printf("%c",194);
gotoxy(9,19);
printf("%c",193);
gotoxy(13,19);
printf("%c",193);
gotoxy(9,7);
printf("%c",194);
gotoxy(9,11);
printf("%c",197);
gotoxy(9,13);
printf("%c",197);
gotoxy(9,15);
printf("%c",197);
gotoxy(9,17);
printf("%c",197);
gotoxy(13,9);
printf("%c",197);
gotoxy(13,11);
printf("%c",197);
gotoxy(13,13);
printf("%c",197);
gotoxy(13,15);
printf("%c",197);
gotoxy(13,17);
printf("%c",197);
//las letras ******************************************************************************************************************************************************
//tabla de verdad
//textcolor(CYAN);
gotoxy(5,3);
printf("TABLA DE VERDAD == NOT ==");
//textcolor(GREEN);
gotoxy(7,8);
printf("A");
gotoxy(11,8);
printf("B");
//textcolor(RED);
gotoxy(15,8);
printf("SALIDA");
//valor 1 *******************************************************************************************************************
gotoxy(7,10);
printf("1");
gotoxy(18,10);
printf("-1");
//indicadores*****************************************************************************************************************************************************
gotoxy(47,5);
printf("A");
gotoxy(72,8);
printf("S=-A");
gotoxy(57,8);
printf("Not");
gotoxy(55,14);
printf("=DIAGRAMA=");
//Pregunta*********************************************************************************************
gotoxy(5,21);
cout<<"Desea elegir alguna otra opcion <s/n> ";
cin>>respuesta;
break;
case 4: clrscr();
gotoxy(30,10);
cprintf("espere por favor");
sleep(1);
cprintf(".");
sleep(1);
cprintf(".");
sleep(1);
cprintf(".");
sleep(1);
clrscr();
system("color 2f");
/*gotoxy(5,5);
//textcolor(GREEN);
//cprintf("TABLA DE VERDAD === XOR ===");
cout <<"TABLA DE VERDAD === XOR ===";
gotoxy(8,7);
cout<<"a"<<endl;
gotoxy(10,7);
cout<<"b"<<endl;
gotoxy(12,7);
cout<<"s"<<endl;
gotoxy(8,9);
cout<<"0"<<endl;
gotoxy(10,9);
cout<<"0"<<endl;
gotoxy(12,9);
cout<<"0"<<endl;
gotoxy(8,11);
cout<<"0"<<endl;
gotoxy(10,11);
cout<<"1"<<endl;
gotoxy(12,11);
cout<<"1"<<endl;
gotoxy(8,13);
cout<<"1"<<endl;
gotoxy(10,13);
cout<<"0"<<endl;
gotoxy(12,13);
cout<<"1"<<endl;
gotoxy(8,15);
cout<<"1"<<endl;
gotoxy(10,15);
cout<<"1"<<endl;
gotoxy(12,15);
cout<<"0"<<endl;
gotoxy(5,18);
cout<<"s=a.b+a.b"<<endl;
gotoxy(7,17);
cout<<"_"<<endl;
gotoxy(13,17);
cout<<"_"<<endl;
gotoxy(5,19);
cout<<"Quieres ver otras opciones < s/n>: ";
cin>>respuesta;*/
//OR
// Lineas H *********************************************
for(x=51;x<=64;x++)
{ gotoxy(x,5);
printf("%c",196);
gotoxy(x,11);
printf("%c",196);}
for(x=45;x<50;x++)
{ gotoxy(x,6);
printf("%c",196);
gotoxy(x,10);
printf("%c",196);}
for(x=66;x<=70;x++)
{ gotoxy(x,8);
printf("%c",196);}
//lineas V********************************************************************************************************
for(y=6;y<=10;y++)
{ gotoxy(50,y);
printf("%c",179);
gotoxy(65,y);
printf("%c",179);}
//conectores ****************************************************************************************************************************************************
gotoxy(50,5);
printf("%c",218);
gotoxy(65,5);
printf("%c",191);
gotoxy(50,11);
printf("%c",192);
gotoxy(65,11);
printf("%c",217);
gotoxy(50,6);
printf("%c",180);
gotoxy(50,10);
printf("%c",180);
gotoxy(65,8);
printf("%c",195);
//tabla OR ***************************************************************************************************************************************************
//lineas horizontales
for(x=5;x<=22;x++)
{ gotoxy(x,7);
printf("%c",196);
gotoxy(x,9);
printf("%c",196);
gotoxy(x,11);
printf("%c",196);
gotoxy(x,13);
printf("%c",196);
gotoxy(x,15);
printf("%c",196);
gotoxy(x,17);
printf("%c",196);
gotoxy(x,19);
printf("%c",196);}
//lineas verticales ********************************************************************************************************************************************
for(y=8;y<=18;y++)
{ gotoxy(5,y);
printf("%c",179);
gotoxy(22,y);
printf("%c",179);
gotoxy(13,y);
printf("%c",179);
gotoxy(9,y);
printf("%c",179);}
//conectores ***************************************************************************************************************************************************
gotoxy(5,7);
printf("%c",218);
gotoxy(22,7);
printf("%c",191);
gotoxy(5,19);
printf("%c",192);
gotoxy(22,19);
printf("%c",217);
gotoxy(5,9);
printf("%c",195);
gotoxy(5,11);
printf("%c",195);
gotoxy(5,13);
printf("%c",195);
gotoxy(5,15);
printf("%c",195);
gotoxy(5,17);
printf("%c",195);
gotoxy(22,9);
printf("%c",180);
gotoxy(22,11);
printf("%c",180);
gotoxy(22,13);
printf("%c",180);
gotoxy(22,15);
printf("%c",180);
gotoxy(22,17);
printf("%c",180);
gotoxy(9,9);
printf("%c",197);
gotoxy(13,7);
printf("%c",194);
gotoxy(9,19);
printf("%c",193);
gotoxy(13,19);
printf("%c",193);
gotoxy(9,7);
printf("%c",194);
gotoxy(9,11);
printf("%c",197);
gotoxy(9,13);
printf("%c",197);
gotoxy(9,15);
printf("%c",197);
gotoxy(9,17);
printf("%c",197);
gotoxy(13,9);
printf("%c",197);
gotoxy(13,11);
printf("%c",197);
gotoxy(13,13);
printf("%c",197);
gotoxy(13,15);
printf("%c",197);
gotoxy(13,17);
printf("%c",197);
//las letras ******************************************************************************************************************************************************
//tabla de verdad
//textcolor(CYAN);
gotoxy(5,3);
printf("TABLA DE VERDAD == XOR ==");
//textcolor(GREEN);
gotoxy(7,8);
printf("A");
gotoxy(11,8);
printf("B");
//textcolor(RED);
gotoxy(15,8);
printf("SALIDA");
//valor 1 *******************************************************************************************************************
gotoxy(7,10);
printf("0");
gotoxy(11,10);
printf("0");
gotoxy(18,10);
printf("0");
//valor 2 ************************************************************************************************************************************************
gotoxy(7,12);
printf("0");
gotoxy(11,12);
printf("1");
gotoxy(18,12);
printf("1");
//valor 3 ****************************************************************************************************************************************************
gotoxy(7,14);
printf("1");
gotoxy(11,14);
printf("0");
gotoxy(18,14);
printf("1");
//valor 4 *********************************************************************************************************************************************************
gotoxy(7,16);
printf("1");
gotoxy(11,16);
printf("1");
gotoxy(18,16);
printf("0");
//indicadores*****************************************************************************************************************************************************
gotoxy(47,5);
printf("A");
gotoxy(47,11);
printf("B");
gotoxy(72,8);
printf("S=A+B");
gotoxy(57,8);
printf("XOR");
gotoxy(55,14);
printf("=DIAGRAMA=");
//Pregunta*********************************************************************************************
gotoxy(5,21);
cout<<"Desea elegir alguna otra opcion <s/n> ";
cin>>respuesta;
break;
case 5: clrscr();
gotoxy(30,10);
cprintf("espere por favor");
sleep(1);
cprintf(".");
sleep(1);
cprintf(".");
sleep(1);
cprintf(".");
sleep(1);
clrscr();
system("color 8f");
/*gotoxy(5,5);
//textcolor(GREEN);
//cprintf("TABLA DE VERDAD === NAND ===");
cout <<"TABLA DE VERDAD === NAND ===";
gotoxy(5,7);
cout<<"a"<<endl;
gotoxy(7,7);
cout<<"b"<<endl;
gotoxy(9,7);
cout<<"s"<<endl;
gotoxy(5,9);
cout<<"0"<<endl;
gotoxy(7,9);
cout<<"0"<<endl;
gotoxy(9,9);
cout<<"1"<<endl;
gotoxy(5,11);
cout<<"0"<<endl;
gotoxy(7,11);
cout<<"1"<<endl;
gotoxy(9,11);
cout<<"1"<<endl;
gotoxy(5,13);
cout<<"1"<<endl;
gotoxy(7,13);
cout<<"0"<<endl;
gotoxy(9,13);
cout<<"1"<<endl;
gotoxy(5,15);
cout<<"1"<<endl;
gotoxy(7,15);
cout<<"1"<<endl;
gotoxy(9,15);
cout<<"0"<<endl;
gotoxy(5,18);
cout<<"s=a*b"<<endl;
gotoxy(7,17);
cout<<"_"<<endl;
gotoxy(8,17);
cout<<"_"<<endl;
gotoxy(9,17);
cout<<"_"<<endl;
gotoxy(5,19);
cout<<"Quieres ver otras opciones < s/n>: ";
cin>>respuesta;*/
//OR
// Lineas H *********************************************
for(x=51;x<=64;x++)
{ gotoxy(x,5);
printf("%c",196);
gotoxy(x,11);
printf("%c",196);}
for(x=45;x<50;x++)
{ gotoxy(x,6);
printf("%c",196);
gotoxy(x,10);
printf("%c",196);}
for(x=66;x<=70;x++)
{ gotoxy(x,8);
printf("%c",196);}
//lineas V********************************************************************************************************
for(y=6;y<=10;y++)
{ gotoxy(50,y);
printf("%c",179);
gotoxy(65,y);
printf("%c",179);}
//conectores ****************************************************************************************************************************************************
gotoxy(50,5);
printf("%c",218);
gotoxy(65,5);
printf("%c",191);
gotoxy(50,11);
printf("%c",192);
gotoxy(65,11);
printf("%c",217);
gotoxy(50,6);
printf("%c",180);
gotoxy(50,10);
printf("%c",180);
gotoxy(65,8);
printf("%c",195);
//tabla OR ***************************************************************************************************************************************************
//lineas horizontales
for(x=5;x<=22;x++)
{ gotoxy(x,7);
printf("%c",196);
gotoxy(x,9);
printf("%c",196);
gotoxy(x,11);
printf("%c",196);
gotoxy(x,13);
printf("%c",196);
gotoxy(x,15);
printf("%c",196);
gotoxy(x,17);
printf("%c",196);
gotoxy(x,19);
printf("%c",196);}
//lineas verticales ********************************************************************************************************************************************
for(y=8;y<=18;y++)
{ gotoxy(5,y);
printf("%c",179);
gotoxy(22,y);
printf("%c",179);
gotoxy(13,y);
printf("%c",179);
gotoxy(9,y);
printf("%c",179);}
//conectores ***************************************************************************************************************************************************
gotoxy(5,7);
printf("%c",218);
gotoxy(22,7);
printf("%c",191);
gotoxy(5,19);
printf("%c",192);
gotoxy(22,19);
printf("%c",217);
gotoxy(5,9);
printf("%c",195);
gotoxy(5,11);
printf("%c",195);
gotoxy(5,13);
printf("%c",195);
gotoxy(5,15);
printf("%c",195);
gotoxy(5,17);
printf("%c",195);
gotoxy(22,9);
printf("%c",180);
gotoxy(22,11);
printf("%c",180);
gotoxy(22,13);
printf("%c",180);
gotoxy(22,15);
printf("%c",180);
gotoxy(22,17);
printf("%c",180);
gotoxy(9,9);
printf("%c",197);
gotoxy(13,7);
printf("%c",194);
gotoxy(9,19);
printf("%c",193);
gotoxy(13,19);
printf("%c",193);
gotoxy(9,7);
printf("%c",194);
gotoxy(9,11);
printf("%c",197);
gotoxy(9,13);
printf("%c",197);
gotoxy(9,15);
printf("%c",197);
gotoxy(9,17);
printf("%c",197);
gotoxy(13,9);
printf("%c",197);
gotoxy(13,11);
printf("%c",197);
gotoxy(13,13);
printf("%c",197);
gotoxy(13,15);
printf("%c",197);
gotoxy(13,17);
printf("%c",197);
//las letras ******************************************************************************************************************************************************
//tabla de verdad
//textcolor(CYAN);
gotoxy(5,3);
printf("TABLA DE VERDAD == NAND ==");
//textcolor(GREEN);
gotoxy(7,8);
printf("A");
gotoxy(11,8);
printf("B");
//textcolor(RED);
gotoxy(15,8);
printf("SALIDA");
//valor 1 *******************************************************************************************************************
gotoxy(7,10);
printf("0");
gotoxy(11,10);
printf("0");
gotoxy(18,10);
printf("1");
//valor 2 ************************************************************************************************************************************************
gotoxy(7,12);
printf("0");
gotoxy(11,12);
printf("1");
gotoxy(18,12);
printf("1");
//valor 3 ****************************************************************************************************************************************************
gotoxy(7,14);
printf("1");
gotoxy(11,14);
printf("0");
gotoxy(18,14);
printf("1");
//valor 4 *********************************************************************************************************************************************************
gotoxy(7,16);
printf("1");
gotoxy(11,16);
printf("1");
gotoxy(18,16);
printf("0");
//indicadores*****************************************************************************************************************************************************
gotoxy(47,5);
printf("A");
gotoxy(47,11);
printf("B");
gotoxy(72,8);
printf("S=A+B");
gotoxy(57,8);
printf("NAND");
gotoxy(55,14);
printf("=DIAGRAMA=");
//Pregunta*********************************************************************************************
gotoxy(5,21);
cout<<"Desea elegir alguna otra opcion <s/n> ";
cin>>respuesta;
break;
case 6:
exit(0);
break;
default:
cout<<"Opcion incorrecta"<<endl;
}
}while(respuesta=='s' || 'S');
getche();
}
La captura de pantalla:
No hay comentarios:
Publicar un comentario