#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<dos.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<process.h>
int aaa=247,bbb=167,l2,status,rep=0,mul=0;
char ch,st2[50],st1[2];
double f1=0,f2=0,d1=0,d2=0,d3=0;
void buttan1(int,int,int,int);
void buttan(int,int,int,int);
void text();
void screen(char);
void scremt();
void main()
{ int d,mm,e,a,b,c,k;
d=DETECT;
initgraph(&d,&mm,"c:/tc");
e=graphresult();
if(e!=0)
{
cout<<"Graphics not inialised";
getch();
return;
}
setbkcolor(BLUE);
setcolor(7);
rectangle(aaa-10,bbb-50,aaa+153,bbb+150);
setfillstyle(1,7);
floodfill(aaa,bbb,7);
setcolor(15);
int f[]={aaa-15,bbb-55,aaa+158,bbb-55,aaa+153,bbb-50,aaa-10,bbb-50,aaa-10,bbb+150,aaa-15,bbb+155,aaa-15,bbb-55};
drawpoly(7,f);
setfillstyle(1,15);
floodfill(aaa-12,bbb-42,15);
setcolor(8);
int h[]={aaa+158,bbb-55,aaa+158,bbb+155,aaa-15,bbb+155,aaa-10,bbb+150,aaa+153,bbb+150,aaa+153,bbb-50,aaa+158,bbb-55};
drawpoly(7,h);
setfillstyle(1,8);
floodfill(aaa+156,bbb-40,8);
for(int ii=1;ii<17;ii++)
{
buttan(aaa,bbb,15,8);
aaa+=39;
if(ii%4==0)
{ bbb+=39;
aaa=247;
}
}
buttan1(236,75,15,8);
buttan1(350,75,15,8);
aaa=247;
bbb=167;
text();
scremt();
REGS n,m;
n.x.ax=0;
int86(0x33,&n,&m);
k=m.x.ax;
if(k==0)
return;
int aa,bb,t1,t2;
while(1)
{ n.x.ax=1;
int86(0x33,&n,&m);
n.x.ax=3;
int86(0x33,&n,&m);
a=m.x.cx;
b=m.x.dx;
c=m.x.bx;
// FOR EXIT XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
if(c==1 && a>350 && a<400 && b>75 && b<100)
{ buttan1(350,75,8,15);
delay(200);
cleardevice();
cleardevice();
setcolor(RED);
outtextxy(50,50,"MADE BY:");
outtextxy(50,80,"UPINDER SINGH DHAMI");
outtextxy(50,110,"B.TECH (FIFTH SEM)");
outtextxy(50,140,"ELECTRONICS AND COMM ENGG");
outtextxy(50,170,"GURU NANAK DEV UNIVERSITY (AMRITSAR)");
outtextxy(50,200,"DATE: 17\\07\\2008");
delay(7000);
return;
}
// FOR RECET XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
if(c==1 && a>236 && a<286 && b>75 && b<100)
{ rep=0;
mul=0;
buttan1(236,75,8,15);
delay(200);
buttan1(236,75,15,8);
strcpy(st2,"");
screen(' ');
scremt();
}
// FOR FIRST ROW XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// FOR 7
if(c==1 && a>aaa && a<(aaa+25) && b>bbb && b<(bbb+25))
{
buttan(aaa,bbb,8,15);
delay(200);
buttan(aaa,bbb,15,8);
screen('7');
mul=0;
continue;
}
// FOR 8
if(c==1 && a>(aaa+39) && a<(aaa+64) && b>bbb&&b<(bbb+25))
{
buttan((aaa+39),bbb,8,15);
delay(200);
buttan((aaa+39),bbb,15,8);
screen('8');
mul=0;
continue;
}
// FOR 9
if(c==1 && a>(aaa+78) && a<(aaa+103) && b>bbb&&b<(bbb+25))
{
buttan((aaa+78),bbb,8,15);
delay(200);
buttan((aaa+78),bbb,15,8);
screen('9');
mul=0;
continue;
}
// FOR +
if(c==1 && a>(aaa+117) && a<(aaa+142) && b>bbb&&b<(bbb+25))
{ rep++;
mul++;
if(mul==2)
{ rep--;
mul--;
}
if(rep==2)
goto label;
status=2;
buttan((aaa+117),bbb,8,15);
delay(200);
buttan((aaa+117),bbb,15,8);
d1=f1;
strcpy(st2,"");
scremt();
continue;
}
//FOR SECOND ROW XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// FOR 4
if(c==1 && a>aaa && a<(aaa+25) && b>(bbb+39) && b<(bbb+64))
{
buttan(aaa,bbb+39,8,15);
delay(200);
buttan(aaa,bbb+39,15,8);
screen('4');
mul=0;
continue;
}
//FOR 5
if(c==1 && a>(aaa+39) && a<(aaa+64) && b>(bbb+39) && b<(bbb+64))
{
buttan(aaa+39,bbb+39,8,15);
delay(200);
buttan(aaa+39,bbb+39,15,8);
screen('5');
mul=0;
continue;
}
//FOR 6
if(c==1 && a>(aaa+78) && a<(aaa+103) && b>(bbb+39) && b<(bbb+64))
{
buttan(aaa+78,bbb+39,8,15);
delay(200);
buttan(aaa+78,bbb+39,15,8);
screen('6');
mul=0;
continue;
}
//FOR -
if(c==1 && a>(aaa+117) && a<(aaa+142) && b>(bbb+39) && b<(bbb+64))
{ rep++;
mul++;
if(mul==2)
{ rep--;
mul--;
}
if(rep==2)
goto label;
status=3;
buttan(aaa+117,bbb+39,8,15);
delay(200);
buttan(aaa+117,bbb+39,15,8);
d1=f1;
strcpy(st2,"");
scremt();
continue;
}
// FOR THIRD ROW XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// FOR 1
if(c==1 && a>aaa && a<(aaa+25) && b>(bbb+78) && b<(bbb+103))
{
buttan(aaa,bbb+78,8,15);
delay(200);
buttan(aaa,bbb+78,15,8);
screen('1');
mul=0;
continue;
}
//FOR 2
if(c==1 && a>(aaa+39) && a<(aaa+64) && b>(bbb+78) && b<(bbb+103))
{
buttan(aaa+39,bbb+78,8,15);
delay(200);
buttan(aaa+39,bbb+78,15,8);
screen('2');
mul=0;
continue;
}
//FOR 3
if(c==1 && a>(aaa+78) && a<(aaa+103) && b>(bbb+78) && b<(bbb+103))
{
buttan(aaa+78,bbb+78,8,15);
delay(200);
buttan(aaa+78,bbb+78,15,8);
screen('3');
mul=0;
continue;
}
//FOR *
if(c==1 && a>(aaa+117) && a<(aaa+142) && b>(bbb+78) && b<(bbb+103))
{ rep++;
mul++;
if(mul==2)
{ rep--;
mul--;
}
if(rep==2)
goto label;
status=1;
buttan(aaa+117,bbb+78,8,15);
delay(200);
buttan(aaa+117,bbb+78,15,8);
d1=f1;
strcpy(st2,"");
scremt();
continue;
}
// FOR FORTH ROW XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// FOR 0
if(c==1 && a>aaa && a<(aaa+25) && b>(bbb+117) && b<(bbb+142))
{
buttan(aaa,bbb+117,8,15);
delay(200);
buttan(aaa,bbb+117,15,8);
screen('0');
mul=0;
continue;
}
// FOR .
if(c==1 && a>(aaa+39) && a<(aaa+64) && b>(bbb+117) && b<(bbb+142))
{
buttan(aaa+39,bbb+117,8,15);
delay(200);
buttan(aaa+39,bbb+117,15,8);
screen('.');
mul=0;
continue;
}
// FOR =
if(c==1 && a>(aaa+78) && a<(aaa+103) && b>(bbb+117) && b<(bbb+142))
{
buttan(aaa+78,bbb+117,8,15);
delay(200);
buttan(aaa+78,bbb+117,15,8);
label:
if(status==1)
{ d2=f1;
d3=d1*d2;
}
if(status==2)
{ d2=f1;
d3=d1+d2;
}
if(status==3)
{ d2=f1;
d3=d1-d2;
}
if(status==4)
{ d2=f1;
d3=d1/d2;
}
char temp[50];
int sig = 10;
gcvt(d3, sig, temp);
strcpy(st2,"");
strcpy(st2,temp);
scremt();
screen(' ');
rep=0;
mul=0;
continue;
}
// FOR %
if(c==1 && a>(aaa+117) && a<(aaa+142) && b>(bbb+117) && b<(bbb+142))
{ rep++;
mul++;
if(mul==2)
{ rep--;
mul--;
}
if(rep==2)
goto label;
status=4;
buttan(aaa+117,bbb+117,8,15);
delay(200);
buttan(aaa+117,bbb+117,15,8);
d1=f1;
strcpy(st2,"");
scremt();
continue;
}
}
getch();
closegraph();
}
void buttan(int x, int y,int ltcolor,int rtcolor)
{
setcolor(7);
rectangle(x,y,x+25,y+25);
setfillstyle(1,7);
floodfill(x+2,y+2,7);
setcolor(ltcolor);
int a[]={ x-2,y-2,x+27,y-2,x+25,y,x,y,x,y+25,x-2,y+27,x-2,y-2};
drawpoly(7,a);
setfillstyle(1,ltcolor);
floodfill(x-1,y+5,ltcolor);
setcolor(rtcolor);
int b[]={x+27,y-2,x+27,y+27,x-2,y+27,x,y+25,x+25,y+25,x+25,y,x+27,y-2 };
drawpoly(7,b);
setfillstyle(1,rtcolor);
floodfill(x+26,y+5,rtcolor);
}
void text()
{ setcolor(4);
outtextxy(aaa+9,bbb+10,"7");
outtextxy(aaa+48,bbb+10,"8");
outtextxy(aaa+87,bbb+10,"9");
outtextxy(aaa+126,bbb+10,"+");
outtextxy(aaa+9,bbb+49,"4");
outtextxy(aaa+48,bbb+49,"5");
outtextxy(aaa+87,bbb+49,"6");
outtextxy(aaa+126,bbb+49,"-");
outtextxy(aaa+9,bbb+88,"1");
outtextxy(aaa+48,bbb+88,"2");
outtextxy(aaa+87,bbb+88,"3");
outtextxy(aaa+126,bbb+88,"*");
outtextxy(aaa+9,bbb+127,"0");
outtextxy(aaa+48,bbb+124,".");
outtextxy(aaa+87,bbb+127,"=");
outtextxy(aaa+126,bbb+127,"%");
outtextxy(243,85,"RESET");
outtextxy(361,85,"EXIT");
settextstyle(7,HORIZ_DIR,1);
outtextxy(aaa+50,bbb+250,"MADE BY: UPINDER SINGH DHAMI");
settextstyle(0,0,1);
}
void screen(char ch)
{ setcolor(15);
rectangle(aaa-5,bbb-40,aaa+148,bbb-10);
setfillstyle(1,15);
floodfill(aaa,bbb-20,15);
// outtextxy(aaa+140,bbb,"0.");
scremt();
if(ch!='a')
{
setcolor(1);
st1[0]=ch;
st1[1]='\0';
strcat(st2,st1);
}
l2=strlen(st2);
if(l2>19)
{ scremt();
setcolor(BLUE);
outtextxy(250,136," data overflow");
return;
}
f1 = atof(st2);
outtextxy(395-(l2*8),136,st2);
}
void scremt()
{ setcolor(14);
rectangle(aaa-5,bbb-40,aaa+148,bbb-10);
setfillstyle(1,14);
floodfill(aaa,bbb-20,14);
}
void buttan1(int x, int y,int ltcolor,int rtcolor)
{
setcolor(7);
rectangle(x,y,x+50,y+25);
setfillstyle(1,7);
floodfill(x+2,y+2,7);
setcolor(ltcolor);
int a[]={ x-4,y-4,x+54,y-4,x+50,y,x,y,x,y+25,x-4,y+29,x-4,y-4};
drawpoly(7,a);
setfillstyle(1,ltcolor);
floodfill(x-3,y-3,ltcolor);
setcolor(rtcolor);
int b[]={x+54,y-4,x+54,y+29,x-4,y+29,x,y+25,x+50,y+25,x+50,y,x+54,y-4};
drawpoly(7,b);
setfillstyle(1,rtcolor);
floodfill(x+52,y+10,rtcolor);
setcolor(1);
}
- Upinder Singh Dhami
- Bangalore, Karnataka, India
- Extending one hand to help someone has more value rather than joining two hands for prayer
Archives
-
▼
2009
(135)
-
▼
September
(132)
- program to print a random number
- program to remove the first and last occurance of ...
- program of selection sort
- program to reverse a string without using inbuilt ...
- program which show the basics of pointer
- program to count characters, words and lines in th...
- program to count vovels,digits,spaces,consonent an...
- program to sort a string
- program to find the number of substrings in a string
- program of password, where you write your password...
- program of dynamic merge
- program of dynamic sort
- program to toogle a string
- program which convert a float value to the string
- program to show the use of gotoxy
- program of merge sort
- calculate the occurance of a word in the string
- program to find the transpose of a matrix
- program to find the largest number in each row of ...
- program to find the sum of rows of the matrix
- program to find the sum of diagonal elements of th...
- program to sort the array using function
- program of seletion sort
- program to search a number present in number of ti...
- program to find the product of matrix
- program to insert the element in the array
- program for binary search of elements which are al...
- program to show basics of linklist
- program to count number of nodes in the link list
- program to count odd values of node in linklist
- program to search a node by value
- program to search a node by value and place a node...
- program to search a node by value and remove it
- program which domonstrate the use of tree
- program to remove alternate nodesin the link list
- program to reversea link list
- program to search a node by value and replace it w...
- program to remove duplicate nodes from the link list
- program to enter the name and email of students us...
- program to show inserting and deleting from a queue
- program to remove a duplicate node from link list
- program to insert an element in the queue
- program to calculate the roots of fourth order alz...
- program to solve three variable linear equation
- simple program of railway reservation
- program to replace the substring with another subs...
- program to reverse each word of the string
- program to save the output as a bitmap image
- program of sparse matrix
- program to add, sub, mul ,and divide two complex n...
- program to find the area and circumference of circ...
- program to show the basics of inline function in oops
- program to print rectangle without using inbuilt f...
- program to print rectangular bowl without using in...
- program to print 'c graphic' in the lines without ...
- program to print menu without using inbuilt functions
- program of loading
- program of loading 2
- program of moving boundries
- program to print all the ascii values
- program to print a barcode
- program to print a line
- program to print a welcome screen?
- program to demonstrate setfillstyle
- program to select the different background colours
- program which demonstrate the text style
- program to demonstrate line style
- program to demonstrate the size of text
- program to print a baby
- program of loading 1
- program of loading 2
- program to print mickey mouse
- program to print a variable box
- program to print database using moving lights arou...
- program to print menu base in graphics
- program to print menu in very good graphic form
- program to enter the values in student database
- program to enter the values of data of form in box...
- program of main menu
- program which define the pixel of the cursor while...
- program to draw lines on the screen with the help ...
- program of moving 3dimensional rectangle box
- program to show menu with the cursor
- program which takes a number from keyboard and giv...
- program which draw rectangles on the screen with t...
- program of digital switches
- program to show the basics os screen saver
- program of text box
- project of editor(like notepad) in c++
- project of banking
- project of hostel management
- project of three dimensional calculator working wi...
- graphical project of students database
- project of shooting game
- Program to find the factorial of a large number
- Solved Placement papers of different IT companies
- there is a matrix N x N .Its elements consist of e...
- program to convert binary number into decimal numb...
- A string of charater is given.Find the highest occ...
- Two sentences are given and we were required to pr...
-
▼
September
(132)
project of three dimensional calculator working with mouse
Tuesday, September 1, 2009Posted by Upinder Singh Dhami at Tuesday, September 01, 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment