Question

make a complete code in c++ or php language to implement a USSD digital voting system...

make a complete code in c++ or php language to implement a USSD digital voting system .The code should run perfectly

Homework Answers

Answer #1
#include<stdio.h>  
#include<graphics.h> 
#include<dos.h>     
#include<conio.h> 
#include<stdlib.h> 
union REGS i,o;
int initmouse();    
void showmouseptr(); 
void restrictmouseptr(int,int,int,int); 
void getmousepos(int *,int *,int *);
void format();     
void graph();     
void welcome();   
void boundry();
int vote1=0,vote2=0,vote3=0,vote4=0,vote5=0;
int button,x,y;
void main()
{      int  gd=DETECT,gm;
       initgraph(&gd,&gm,"c:\\tc\\bgi"); 
       randomize();
       boundry();
     welcome();          
     cleardevice();       
     format();               
     showmouseptr();
     restrictmouseptr(0,0,675,435); 
do
{
getmousepos(&button,&x,&y);
 if((button&1)==1&&x>475&&x<580&&y>250&&y<280)
{   break;}
else if((button&1)==1&&x>280&&x<380&&y>105&&y<125)
{  setcolor(RED);circle(270,115,5);
   sound(1200);
   delay(500);
   nosound();
   setcolor(BLACK);circle(270,115,5);
   vote1++;   }
else if((button&1)==1&&x>280&&x<380&&y>155&&y<175)
{  setcolor(RED);circle(270,165,5);
   sound(1200);
   delay(500);
   nosound();
   setcolor(BLACK);circle(270,165,5);
   vote2++;   }
else if((button&1)==1&&x>280&&x<380&&y>205&&y<225)
{  setcolor(RED);circle(270,215,5);
   sound(1200);
   delay(500);
   nosound();
   setcolor(BLACK);circle(270,215,5);
   vote3++;   }
else if((button&1)==1&&x>280&&x<380&&y>255&&y<275)
{  setcolor(RED);circle(270,265,5);
   sound(1200);
   delay(500);
   nosound();
   setcolor(BLACK);circle(270,265,5);
   vote4++;   }
else if((button&1)==1&&x>280&&x<380&&y>305&&y<325)
{  setcolor(RED);circle(270,315,5);
   sound(1200);
   delay(500);
   nosound();
   setcolor(BLACK);circle(270,315,5);
   vote5++;   }
}             
while(1);

 cleardevice();
 initmouse();
 showmouseptr();
  boundry();
 graph();
 getch();
}                   
void boundry()
{
   setcolor(1+random(14));
   rectangle(0,0,635,475);
   setcolor(1+random(14));
   rectangle(3,3,632,472);
}
void welcome()
{ randomize();
  settextstyle(8,0,4);
  setcolor(1+random(14));
  outtextxy(200,100,"WELCOME");
  delay(800);
  setcolor(1+random(14));
  outtextxy(250,160,"TO");
  delay(800);
  setcolor(1+random(14));
  outtextxy(50,220,"ELECTRONIC VOTING SYSTEM");
  delay(800);
  while(!kbhit())
  {  setcolor(1+random(14));
     outtextxy(50,400,"Press any key to continue.....");
     delay(500);
     setcolor(BLACK);
     outtextxy(50,400,"Press any key to continue.....");
     delay(500);
  }


}

void format()
{   setcolor(6);
    rectangle( 90,30,400,380);
    rectangle( 87,27,403,383);
    settextstyle(0,0,5);
    outtextxy(140,40,"E V M");
    line(90,80,400,80);
    settextstyle(8,0,2);
    outtextxy(100,100,"MEGHA");
    rectangle(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);

    outtextxy(100,150,"BURNOWAL");
    rectangle(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);

    outtextxy(100,200,"ABUTALIB");
    rectangle(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);
    outtextxy(100,250,"KUMAR");
    rectangle(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);

    outtextxy(100,300,"ARJUN");
    rectangle(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);

    rectangle(475,250,580,280);
    outtextxy(480,250,"RESULTS");

    outtextxy(50,400,"Presented By:- EFY Enterprises Pvt Ltd");
}
void showmouseptr()
{
i.x.ax=1;
int86(0x33,&i,&o);
}
void restrictmouseptr(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 getmousepos(int *button, int *x, int *y)
{   i.x.ax=3;
    int86(0x33,&i,&o);
    *button=o.x.bx;
    *x=o.x.cx;
    *y=o.x.dx;
}
void graph()
{   outtextxy(200,100,"RESULTS(in % votes)");
    int candidate1=((vote1*100)/(vote1+vote2+vote3+vote4+vote5));
    int candidate2=((vote2*100)/(vote1+vote2+vote3+vote4+vote5));
    int candidate3=((vote3*100)/(vote1+vote2+vote3+vote4+vote5));
    int candidate4=((vote4*100)/(vote1+vote2+vote3+vote4+vote5));
    int candidate5=((vote5*100)/(vote1+vote2+vote3+vote4+vote5));
    setcolor(2);
    rectangle(100,300,130,300-candidate1);outtextxy(100,300,"ME");
    rectangle(200,300,230,300-candidate2);outtextxy(200,300,"BU");
    rectangle(300,300,330,300-candidate3);outtextxy(300,300,"AB");
    rectangle(400,300,430,300-candidate4);outtextxy(400,300,"KU");
    rectangle(500,300,530,300-candidate5);outtextxy(500,300,"AR");

    setcolor(1+random(14));
    rectangle(545,400,600,430);
    outtextxy(550,400,"EXIT");

    do
{
getmousepos(&button,&x,&y);
 if((button&1)==1&&x>545&&x<600&&y>400&&y<430)
{   break;}
}               // END OF DO
while(1);


}
initmouse()
{
i.x.ax=0;
int86(0x33,&i,&o);
return(o.x.ax);
}
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a programming code in php language to implement/run a USSD digital voting system ..The programming...
Write a programming code in php language to implement/run a USSD digital voting system ..The programming code should work perfectly
Implement the following C++ code in assembly language. Substitute calls to WriteString for the printf() function...
Implement the following C++ code in assembly language. Substitute calls to WriteString for the printf() function calls: double X; double Y; if(x<Y) printf("X is lower\n"); else printf("X is not lower\n");
Write an insertion sort algorithm in C language by performing following steps .make sure code is...
Write an insertion sort algorithm in C language by performing following steps .make sure code is work. thanks Prompt the user to enter the number of array elements (say, N). Read the number of elements (N). Implement the insertion sort algorithm (note that insertion sort is an in-place sort that modifies the original array). Print the sorted array.
C PROGRAMMING LANGUAGE The following code written in C programming language was run and displays 997705320....
C PROGRAMMING LANGUAGE The following code written in C programming language was run and displays 997705320. Explain why and how this program outputs this number. int main(void) { int a = 5, b =20; int* ptr = &a; int** ptr2 = &ptr; printf("%d\n", ((int)*ptr * (int)*ptr2)); return 0; }
Write and test code in MIPS assembly language program to implement algorithms "The Non-Restoring Algorithm "of...
Write and test code in MIPS assembly language program to implement algorithms "The Non-Restoring Algorithm "of an 8-bit integer the user shoud insert the number then by the algo well find the square root
(c) language What is the code that is required to define the node and the header...
(c) language What is the code that is required to define the node and the header for a linked list of the ages of your family members in decreasing order along with the name you refer to that person as (the nickname e.g. dad 59). Specify only the typedef of the node and the declaration of the header. YOU DO NOT NEED THE CODE To make the linked list.
Implement a COMPLETE GUI application for a pharmacy using Java as programming language NO DATABASE BACKEND...
Implement a COMPLETE GUI application for a pharmacy using Java as programming language NO DATABASE BACKEND IS NEEDED Instead the application should include necessary forms & functions for below activities : HR : manage employees, including their leaves and salary Payroll : manages salary of each employee Inventory : manages the stock of the pharmacy Supplier : procurement of medicines Sales : manages the sales done for each employee The implementation should also be based on object-oriented concepts, and students...
Please code in Java and please implement constarints Digital Root and Iterations Given a non-negative integer,...
Please code in Java and please implement constarints Digital Root and Iterations Given a non-negative integer, print out its digital root and the number of iterations required to reach it. The digital root is the single digit number obtained by an iterative process of finding the sum of digits. In the next iteration, the sum of the digits in the previous iteration is computed, and the process repeated until a single digit value is obtained. Input Format The first line...
Please create a C++ code that is around 20-30 lines of code and make it compile...
Please create a C++ code that is around 20-30 lines of code and make it compile and run showing how to use templates, overloading, and vectors (define these functions in the code)
Perl language and by using VS Code: Write a program that reads a number, adds up...
Perl language and by using VS Code: Write a program that reads a number, adds up the cube of all the digits, and displays the result. Run your code with the following test number: 1242 It should give 81. Please include screenshots of your outputs.