You are on page 1of 11

A Group Project Report on

ELECTION VOTING SYSTEM

Submitted to
The Department of Computer Science and Engineering

By

P.SAI SHASANK 22311A6210


B.VIDYA SAI CAHRAN REDDY 22311A6201
A.ASHISH 22311A6261
K.SAI TEJA 22311A6219
B.ASHISH 22311A6245

Under the Guidance of


Prof. Abdul Khalandar

Sreenidhi Institute of Science and


Technology
(An Autonomous Institution)
Yamnampet, Ghatkesar, R.R. District, Hyderabad

Principal

In-Charge / Supervisor Head of the Dept.

pg. 1
CONTENTS

S.NO TOPIC NAME PAGE NO.

1. Introduction 3-4

2. Source Code 5- 9

3. Screen Shots (Output Screen) 10

4. Conclusion 11

pg. 2
INTRODUCTION
Welcome to election voting system project in c. In this project we will
be developing a program that stimulates the process of election. This
program will allow users to cast their vote for a particular candidate
and then tally the vote the winner.
In this project we will be implementing an
election voting system in c programming language. We will use the
basic concepts of c programming, including dma, functions and
conditional statements, to design and develop a simple yet effective
voting system. The program will allow the user to select their
preferred candidate, and the voters I’d will be recorded in a file.

We will also be implementing basic security measures to ensure that


the election is conducted in a fair and transparent manner. The
system will keep tract of the number of votes cast. We will also
provide an option for voter to verify their vote and ensure that it has
the vote will be recorded in a file.

The word VOTE means to choose from a list, to elect or to


determine.The main goal of voting (in a scenario involving the
citizens of a given country) is to come up with leaders of the people’s
choice.Most countries, India not an exception have problems when it
comes to voting. Some of the problems involved include ridging
votes during election, insecure or inaccessible polling
stations,inadequate polling materials and also inexperienced
personnel.

pg. 3
Here we are proposing a c program for voting process . The online
voting system will manages the voter’s details,Candidate details. The
main feature of the project includes voters information and
candidate information, voter can login and use his/her voting rights.
The system can manage the information data very efficiently.The
proposed system is more reliable, faster, accurate and easy to handle
compared to existing manual system. It helps to computerize
everything and reducing the errors as compare to manual voting
system.

Overall this project will provide an


excellent opportunity to learn the basics of c programming while
also gaining insights into the design and development of a simple
voting system.

pg. 4
SOURCE CODE :
#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#define CANDIDATE_COUNT

int votesCount1=0, votesCount2=0, votesCount3=0, votesCount4=0,


spoiledtvotes=0;

struct candidate{

char str[100];

int pc;

};

void castVote(struct candidate *p){

int choice;

unsigned long long n;

strcpy(p[0].str,"KCR");

strcpy(p[1].str,"KTR");

pg. 5
strcpy(p[2].str,"kYR");

strcpy(p[3].str,"kMR");

p[0].pc=1001,p[1].pc=1002,p[2].pc=1003,p[3].pc=1004;

FILE *fp;

fp=fopen("project.c","a+");

printf("Enter your Aadhar number : ");

scanf("%llu",&n);

fprintf(fp,"%llu\n",n);

fclose(fp);

printf("\n\n ### Please choose your Candidate ####\n\n");

printf("\n 1. %s(party code-%d)",p[0].str,p[0].pc);

printf("\n 2. %s(party code-%d)",p[1].str,p[1].pc);

printf("\n 3. %s(party code-%d)",p[2].str,p[2].pc);

printf("\n 4. %s(party code-%d)",p[3].str,p[3].pc);

printf("\n 5. %s", "None of These");

printf("\n\n Input your choice (1 - 4) : ");

scanf("%d",&choice);

switch(choice){

case 1: votesCount1++; break;

pg. 6
case 2: votesCount2++; break;

case 3: votesCount3++; break;

case 4: votesCount4++; break;

case 5: spoiledtvotes++; break;

default: printf("\n Error: Wrong Choice !! Please retry");

//hold the screen

getchar();

printf("\n thanks for vote !!");

void votesCount(struct candidate *p){

printf("\n\n ##### Voting Statics ####");

printf("\n %s - %d ", p[0].str, votesCount1);

printf("\n %s - %d ", p[1].str, votesCount2);

printf("\n %s - %d ", p[2].str, votesCount3);

printf("\n %s - %d ", p[3].str, votesCount4);

printf("\n %s - %d ", "Spoiled Votes", spoiledtvotes);

pg. 7
void getLeadingCandidate(struct candidate *p){

printf("\n\n #### Leading Candidate ####\n\n");

if(votesCount1>votesCount2 && votesCount1>votesCount3 &&


votesCount1 >votesCount4)

printf("[%s]",p[0].str);

else if (votesCount2>votesCount3 && votesCount2>votesCount4


&& votesCount2 >votesCount1)

printf("[%s]",p[1].str);

else if(votesCount3>votesCount4 && votesCount3>votesCount2


&& votesCount3 >votesCount1)

printf("[%s]",p[2].str);

else if(votesCount4>votesCount1 && votesCount4>votesCount2


&& votesCount4 >votesCount3)

printf("[%s]",p[3].str);

else

printf("----- Warning !!! No-win situation----");

int main()

pg. 8
struct candidate *p = malloc(4*sizeof(struct candidate));

int i;

int choice;

do{

printf("\n\n ======= Welcome to Election/Voting 2023 =======");

printf("\n\n 1. Cast the Vote");

printf("\n 2. Find Vote Count");

printf("\n 3. Find leading Candidate");

printf("\n 0. Exit");

printf("\n\n Please enter your choice : ");

scanf("%d", &choice);

switch(choice)

case 1: castVote(p);break;

case 2: votesCount(p);break;

case 3: getLeadingCandidate(p);break;

default: printf("\n Error: Invalid Choice");}

}while(choice!=0);

getchar();

return 0;

pg. 9
pg. 10
CONCLUSION
This project emphasizes an user friendly interface for casting
the vote, as the objective of the project is to make reliable
system for recording and counting votes in an election.
Actually the design of the project the user has an access to
caste the vote and can see the statistics of the vote counts of
the candidate. The program calculates the number of votes
and displays the leading candidate to the user. As to avoid
some unfair means to vote the program takes the users
voterId before casting the vote. The program stores the users
Id in the file. In case of program malfunction it is easy to
rectify as the program is build module wisely. The potential
improvements that could be made to the system in the
future such as biometric authentication, data storage
methods and efficiency. overally the program gives a better
a experience with good efficiency.

The traditional method of manual voting has


few drawbacks and it is obviously not efficient and wastes
voter’s energy, in terms of efficiency it takes lot of time
completion. This smart system involves the increase in
efficiency and voters can caste their vote easily.

pg. 11

You might also like