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");
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
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...
The language of code in C#. Finds the number of times a word occurs by itself...
The language of code in C#. Finds the number of times a word occurs by itself (as a complete word) or as part of another word in the given "wordFragment" substring. For example in the string "The bon in bonbon", we count 2 occurrences of bon. Please write a simple code without the use of advanced features such as LINQ. It's recommended using the Dictionary feature. Returns the number of times wordFragment occurs in the file that WordCounter is associated...
(MIPS Assembly Language): Write the following sequence of code using *native* MIPS instructions: x = x...
(MIPS Assembly Language): Write the following sequence of code using *native* MIPS instructions: x = x - y[0] + y[1]; In memory x, y are stored beginning at 0x010000cc. Use registers $s1 for x,  and $s2 for the base address of y. Make sure your code includes all necessary declarations such that it could run in SPIM.
Please complete in MASM (x86 assembly language). Use the code below to get started. Write a...
Please complete in MASM (x86 assembly language). Use the code below to get started. Write a program that uses a loop to calculate the first seven values of the Fibonacci number sequence, described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n – 1) + Fib(n – 2). .386 .model flat,stdcall .stack 4096 ExitProcess PROTO,dwExitCode:DWORD .data    ; define your variables here .code main PROC    ; write your assembly code here    INVOKE ExitProcess,0 main...
c Give THREE importance of the wellsite digital computer system (CSU).
c Give THREE importance of the wellsite digital computer system (CSU).
FROM The HCS12 / 9S12 (2nd Edition) E4.19 please use C language to write the code...
FROM The HCS12 / 9S12 (2nd Edition) E4.19 please use C language to write the code and submit the code and pictures of the running circuit on the board. (1) Write an instruction sequence to configure Port A and Port B for input and output, respectively; read the value of Port A and output the value to Port B.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT