EVM.CPP

Electronics For You - - SECTION -

} >305&&y<325) { set­color(RED);circle(270,315,5); sound(1200); de­lay(500); nosound(); set­color(BLACK);circle(270,315,5); vote5++; } } // END OF DO while(1); clearde­vice(); init­mouse(); show­mouseptr();

boundry(); graph(); getch(); } TION void boundry() { set­color(1+ran­dom(14)); rec­tan­gle(0,0,635,475); set­color(1+ran­dom(14)); rec­tan­gle(3,3,632,472); } void wel­come() { ran­dom­ize(); set­textstyle(8,0,4); set­color(1+ran­dom(14)); out­tex­txy(200,100,”WEL­COME”); de­lay(800); set­color(1+ran­dom(14)); out­tex­txy(250,160,”TO”); de­lay(800); set­color(1+ran­dom(14));

out­tex­txy(50,220,”ELEC­TRONIC VOT­ING SYS­TEM”); de­lay(800); while(!kb­hit()) { set­color(1+ran­dom(14));

out­tex­txy(50,400,”Press any key to continue.....”); de­lay(500); set­color(BLACK); out­tex­txy(50,400,”Press any key to continue.....”);

de­lay(500);

// END OF MAIN FUNC- void for­mat() { set­color(6); rec­tan­gle( 90,30,400,380); rec­tan­gle( 87,27,403,383); set­textstyle(0,0,5); out­tex­txy(140,40,”E V M”); line(90,80,400,80); set­textstyle(8,0,2); out­tex­txy(100,100,”MEGHRAJ”); rec­tan­gle(95,100,250,130); arc(290,115,90,270,10); arc(370,115,270,90,10); line(290,105,370,105); line(290,125,370,125); out­tex­txy(100,150,”DI­NESH”); rec­tan­gle(95,150,250,180); arc(290,165,90,270,10); arc(370,165,270,90,10); line(290,155,370,155); line(290,175,370,175); out­tex­txy(100,200,”RAKESH”); rec­tan­gle(95,200,250,230); arc(290,215,90,270,10); arc(370,215,270,90,10); line(290,205,370,205); line(290,225,370,225); out­tex­txy(100,250,”DEEPAK”); rec­tan­gle(95,250,250,280); arc(290,265,90,270,10); arc(370,265,270,90,10); line(290,255,370,255);

line(290,275,370,275); out­tex­txy(100,300,”ANU­JAY”); rec­tan­gle(95,300,250,330); arc(290,315,90,270,10); arc(370,315,270,90,10); line(290,305,370,305); line(290,325,370,325); rec­tan­gle(475,250,580,280); out­tex­txy(480,250,”RE­SULTS”);

out­tex­txy(50,400,”Pre­sented By:- EFY En­ter­prises Pvt Ltd”); } void show­mouseptr() { i.x.ax=1; int86(0x33,&i,&o); } void re­strict­mouseptr(int x1, int y1, int x2, int y2) { i.x.ax=7; i.x.cx=x1; i.x.dx=x2; int86(0x33,&i,&o); i.x.ax=8; i.x.cx=y1; i.x.dx=y2; int86(0x33,&i,&o); } void get­mouse­pos(int *but­ton, int *x, int *y) { i.x.ax=3; int86(0x33,&i,&o); *but­ton=o.x.bx; *x=o.x.cx; *y=o.x.dx; } void graph() { out­tex­txy(200,100,”RE­SULTS(in votes)”);

int can­di­date1=((vote1*100)/(vote1+ vote2+vote3+vote4+vote5));

int can­di­date2=((vote2*100)/(vote1+ vote2+vote3+vote4+vote5));

int can­di­date3=((vote3*100)/(vote1+ vote2+vote3+vote4+vote5));

int can­di­date4=((vote4*100)/(vote1+ vote2+vote3+vote4+vote5));

int can­di­date5=((vote5*100)/(vote1+ vote2+vote3+vote4+vote5)); set­color(2); rec­tan­gle(100,300,130,300-can­di­date 1);out­tex­txy(100,300,”ME”);

rec­tan­gle(200,300,230,300-can­di­date 2);out­tex­txy(200,300,”DI”);

rec­tan­gle(300,300,330,300-can­di­date 3);out­tex­txy(300,300,”RA”);

rec­tan­gle(400,300,430,300-can­di­date 4);out­tex­txy(400,300,”DE”);

rec­tan­gle(500,300,530,300-can­di­date 5);out­tex­txy(500,300,”AN”); set­color(1+ran­dom(14)); rec­tan­gle(545,400,600,430); out­tex­txy(550,400,”EXIT”); do { get­mouse­pos(&but­ton,&x,&y);

if((but­ton&1)==1&&x>545&&x<600&&y>400 &&y<430) { break;} } while(1);

// END OF DO } init­mouse() { i.x.ax=0; int86(0x33,&i,&o); re­turn(o.x.ax); }

%

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.