1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
#include<fstream.h> //for reading and writing files
#include<conio.h> //for clrscr()
#include<string.h> //for string characters
#include<stdio.h> //for gets and puts function
#include<process.h> //for exit function
#include<iomanip.h> //for setw function
#include<dos.h> //for delay and sleep function
class word
{
int man;
public:
void add();
};
void word::add()
{
cout<<"GOD IS GREAT";
};
void main()
{ char ch,c=0,che=16;
int i=1,j=16;
do
{
gotoxy(35,11);cout<<"MAIN MENU";
gotoxy(35,12);cout<<"___________";
gotoxy(13,16);cout<<"A.ADD";
gotoxy(13,18);cout<<"B.DISPLAYALL";
gotoxy(13,20);cout<<"C.DISPLAYINDIVIDUAL";
gotoxy(13,22);cout<<"D.DELETE";
gotoxy(52,16);cout<<"E.MODIFY";
gotoxy(52,18);cout<<"F.SALE";
gotoxy(52,20);cout<<"G.EXIT";
gotoxy(26,27);cout<<"USE ARROWS TO NAVIGATE";
gotoxy(i,j);cout<<che;
do
{ch=getch();
if(ch==72&&j-2>=16)
{gotoxy(i,j);cout<<c;j-=2;gotoxy(i,j);cout<<che<<"\b";}
if(ch==75&&i-13>=13)
{gotoxy(i,j);cout<<c;i-=39;gotoxy(i,j);cout<<che<<"\b";}
if(ch==77&&i+39<=52)
{gotoxy(i,j);cout<<c;i+=39;gotoxy(i,j);cout<<che<<"\b";}
if(ch==80&&j+2<=22)
{gotoxy(i,j);cout<<c;j+=2;gotoxy(i,j);cout<<che<<"\b";}
}while(ch!=13);
cout<<"\a";
switch(ch)
{
case 13:
if(i==11&&j==16)
{
clrscr();
void add();
cout<<"ADDED";
cout<<"\a\a\a\a\a\a\a\a\a\a";
break;
}
else if(i==11&&j==18)
{
cout<<"DISPLAYEDALLMAN";
cout<<"\a\a";
break;
}
else if(i==11&&j==20)
{
cout<<"DISPLAYED INDIVIDUAL";
cout<<"\a";
break;
}
else if(i==11&&j==22)
{
cout<<"DELETED";
cout<<"\a";
break;
}
else if(i==50&&j==16)
{
cout<<cout<<"modified";
cout<<"\a";
break;
}
else if(i==50&&j==18)
{
cout<<"SOLD";
cout<<"\a";
break;
}
else if(i==50&&j==20)
{
cout<<"EXIT";
break;
}
}
}while(ch);
}
|