You are on page 1of 48

NANDHA CENTRAL CITY SCHOOL [CBSE]

ERODE-638011

COMPUTER SCIENCE PROJECT


“VOTING SYSTEM”

Submitted in partial fulfilment of the requirement of the


ALL INDIA SENIOR SECONDARY CERTIFICATE
EXAMINATION (AISSCE)

Developed by:
BHUMIKA KOCHAR.P
(Register No :)

NANDHA CENTRAL CITY SCHOOL [CBSE]


ERODE-638011

CERTIFICATE
This is to certify Bhumika kochar.P of class XII commerce of Nandha
Central City School has successfully completed the Computer Science
project entitled “Voting System” for the partial fulfilment of AISSCE
as prescribed by CBSE in the year 2023-24.
Signature of the Guide Signature of the Principal

Signature of the Internal Signature of the external


Examiner Examiner

ACKNOWLEDGEMENT

First and foremost I praise and thank almighty from the depth of my
heart, which has been the source of strength in the completion of my
project.

I extend my sincere thanks to Mr.A.G.Prakash Nair,MA(eng),


MA(soc), LLB, LLM, MBA, B.Ed Principal for his co-ordination in
extending every possible support for the completion of this project.

I would like to express a deep sense of thanks & gratitude to my teacher


in charge Mr.G.Manickasundaram. MCA, guiding for me immensely
through the course of the project. He always evinced keen interest in
my work.

I also thank my Parents for their motivation & support. I must thank my
classmates for their timely help support for completion of this project.
Last but not least, I would like to thank all those who had helped
directly or indirectly towards the completion of this project.

INDEX

S.NO CONTENTS PAGE NO.

1. Problem Definition 6

2. Problem Analysis 8

3. Software and Hardware Requirements 9

4. Scope for Future Enhancement 10

5. Source Code 12

6. Output 24

7. Bibliography 43
CONTENTS

• Problem Definition

• Problem Analysis

• Hardware and Software Requirements

• Scope for Future Enhancement

• Source Code

• Output

• Bibliography


PROBLEM DEFINITION:
In This modern and technologically developed era everything has
started to undergo digitalization. For example we have started to do
digital payment, online shopping, and applying application form via
online, video conferencing and so on.

This digitalization has made our life much easier than before and we
have the access within our hands. This digitalization has increased
the productivity and it is time saving too.

This digitalization can also be done in election (voting system) also.


We have central and state election in a regular interval of five years.
In order to simplify and increase the efficiency of election we can
add a digital touch to it by making it digital. This digitalization also
makes the voting experience much better as compared to the normal
one. This also increases the safety of these data as they are much
crucial and important.
MEMBER FUNCTIONUSEDIN COVID MANAGEMENT:

• admin module: This module is the gateway of getting into the


admin database and future accessing it.
• overall module: This module displays the menu of this process
which includes registration of parties, registration of candidate,
registration of voters and election process.
• Partyregistration module: This module is used to register all the
parties that are going to contest in the election by collecting each
and every required information of the parties.
• candidateregistration module: This module is used to register all
the candidates who are going to contest in the election by
collecting each and every required information of the candidates.
• Voterregistration module: This module is used to register all the
voters who are going to cast their vote in the election by collecting
each and every required information of the voters.
• election module: In this module the voter’s ID and candidate’s ID
will be checked and then the voter’s can cast their votes and at last
the result the election will be displayed
PROBLEM ANALYSIS:
There are six tables created in this system namely,
• candidateid: This table contains the personal information of
candidate who are contesting the in the election.
• candidatedetails: This table contains the information of each and
every candidate that is required for candidate registration which is
very much needed for the election process.
• election: This table contains the information needed for election
like how much votes did each candidate got in this election.
• party:This table contains the information about each and every
parties contesting in the election which is required for parties
registration in order to take part in the election
• voter:This table contains the personal information of each and
every voter which is required for voter’s registration which is
required in order to cast their vote the election.
• voterdetails:This table This table contains the personal
information of voter which is much needed for this election
process as it shows their identity.


HARDWARE AND SOFTWARE REQUIREMENTS:

• Hardware:

• Monitor, Keyboard, Mouse.


• Computer with RAM of atleast 1 GB.
• System Type: Atleast 32 bit operating system.

• Software:

• Windows (7/8/10) or Linux.

• Programming Language: Python 3.7 or Later.

SCOPE FOR FUTURE DEVELOPMENT:


A progressive search of the database related to the digital voting system
has been made. This can reach its next level when we use Artificial
Intelligence and other technologies to increase its standards.

Digitalization of election is one of the most sensitive topics as it requires


very minute detailing in order to have a smooth election process. Even in
future we can even take it to a global level. The future advancement can
be as,
• Efficiency in storing data and sharing it:All the data that is
obtained by the process are very much important and crucial. Here
we can implement some advanced technologies to store the data
safely and all this data’s can also be transferred with high level of
safety with in state or within the country by covering a wide range.
• Collection of past election reports: This can also be used a take
surveys to check how much members have totally voted in all the
previous elections and whether the participation of people in
voting has increased or not and the winning ratio of each political
parties in all the previous years can be calculated.
• Integrating it with Artificial Intelligence: The AI collaboration
can drastically help in the future to produce better results. For
example we can use some sensors and camera which can detects
the person’s finger print and physical identity to avoid the chances
of fraudulent activities in voting to a greater extent.
The project done here can be implemented in future for all the elections
and can make the huge task seem lighter.
SOURCE CODE:

#admin – module1
def admin (name, password):
print("\n WELCOME\n")
name=input('enter username:')
if name=='bja':
password=int(input('enter the password:'))
if password!=1123:
print('invalid password')
else:
from overall import regg
regg()
else:
print('invalid username')
name='bja'
password=1123
admin(name,password)

#overall-module2
def regg():
while True:
print('\n1.PARTY REGISTRATION')
print('2.CANDIDATE REGISTRATION')
print('3.VOTERS REGISTRATION')
print('4.ELECTION')
ch=int(input("choose an option(1,2,3,4)"))
if ch==1:
from partyregistration import reg1
reg1()
elif ch==2:
from candidateregistration import reg2
reg2()
elif ch==3:
from voterregistration import reg3
reg3()
elif ch==4:
from election import reg4
reg4()
regg()

#partyregistration-module3
import random
import mysql.connector as mc
conobj=mc.connect(host='localhost',user='root',passwd='Student@
123',database='admin')
if conobj.is_connected:
print('connected')'''
curobj=conobj.cursor()
curobj.execute("create table if not exists party(party_id int primary
key,party_name varchar(100), number_of_members
int,documents_submitted varchar(5),\
affadavits_sign varchar(5), Assets_and_liabilities_details
varchar(5),Criminal_details varchar(5),Application_Form
varchar(5), Demand_Draft varchar(5))")
'''print('created')
def reg1():
while True:
print(' \t \t PARTY REGISTRATION \t \t')
pname=input('Enter the party name:')
mn=int(input('Enter the number of members in the party:'))
if mn>=100:
doc=input('Are the required documents for party registration
verified and submitted?(yes/no):')
if doc=='yes':
aff=input("Is there president's sign on the Individual's
affadavits?(yes/no):")
if aff=='yes':
al=input('Are the details of assets and liabilties
submitted?(yes/no)')
if al=='yes':
cr=input("Is the Individual affadavits of criminal
background been submitted?(yes/no)")
if cr=='yes':
ap=input('Is the application form submitted?(yes/no)')
if ap=='yes':
dd=input('Is the denomination(demand draft) of
rs.10,000/- paid?(yes/no)')
pid=random.randint(10000,100000)
print('Party registered')
else:
print('pay the denomination')
else:
print('application pending')
else:
print('submit the affadavit')
else:
print('submit the documents of Assets&Liabilities')
else:
print('this party cannot be formed unless the affadavits are
signed by the president')
else:
print('minimum members to start a new political party is 100')
curobj.execute("insert into
party(party_id ,party_name,number_of_members,
documents_submitted,affadavits_sign,Assets_and_liabilities_detail
s,Criminal_details,Application_Form,Demand_Draft)
values({},'{}',{},'{}','{}','{}','{}','{}','{}')".format(pid,pname,mn,d
oc,aff,al,cr,ap,dd))
conobj.commit()
duwtc=input('duwtc(y/n):')
if duwtc=='n':
break

#candidateregistration-module4
import random
import mysql.connector as mc
conobj=mc.connect(host='localhost',user='root',passwd='Student@
123',database='admin')
curobj=conobj.cursor()
curobj.execute("create table if not exists candidateid(candidate_id
int primary key, candidate_name varchar(30) not null, party
varchar(30),sex varchar(10) not null,date_of_birth varchar(20) not
null,age varchar(10) not null,education_qualification varchar(50)
not null,phone_number varchar(10) not null,email_id varchar(50)
not null,address varchar(50) not null,pincode varchar(20) not
null)")

curobj.execute("create table if not exists


candidatedetails(candidate_id int primary key, candidate_name
varchar(30) not null,party varchar(100) not
null,membercard_number varchar(30) not null
unique,date_of_issue varchar(20) not null,place_of_issue
varchar(50)not null,pan_number varchar(20) not null
unique,aadhar_number varchar(20) not null unique)")

def reg2():
while True:
print(' \t \t CANDIDATE REGISTRATION \t \t')
cn=input('enter the candidate full name:')
pn=input('enter the party he/she belongs to:')
mc=input('enter member card number:')
isd=input('enter date of issue(yyyy-mm-dd):')
poi=input('enter place of issue:')
s=input('enter sex(m/f/o):')
dob=input('enter date of birth(yyyy-mm-dd):')
age=input('enter current age:')
ed=input('enter the educational qualifications:')
while True:
no=input('enter the phone number:')
if len(no)==10 and no.isdigit():
break
em=input('enter email id:')
ad=input('enter the address:')
pin=input('enter your pincode:')
pan=input('enter PAN number:')
adh=input('enter aadhar number:')
mid=random.randint(1000,10000)
curobj.execute("insert into
candidateid(candidate_id,candidate_name,party,sex,date_of_birth,
age,education_qualification,phone_number,email_id,address,pinco
de)
values({},'{}','{}','{}','{}','{}','{}','{}','{}','{}','{}')".format(mid,cn,
pn,s,dob,age,ed,no,em,ad,pin))

curobj.execute("insert into candidatedetails


(candidate_id,candidate_name,party,membercard_number,date_of
_issue, place_of_issue, pan_number,aadhar_number)
values({},'{}','{}','{}','{}','{}','{}','{}')".format(mid,cn,pn,mc,isd,
poi,pan,adh))
conobj.commit()
curobj.execute("select * from candidateid")
d=curobj.fetchall()
for i in d:
if i[0]==mid:
print("value already exists")
break
else:
print("add record")
break
conobj.commit()
duwtc=int(input("duwtc(1/2)"))
if duwtc==2:
break
#voterregistration-module5
import random
import mysql.connector as mc
conobj=mc.connect(host='localhost',user='root',passwd='Student@
123',database='admin')
if conobj.is_connected:
print('connected')
curobj=conobj.cursor()

curobj.execute("create table if not exists voter(vid int primary


key,vname varchar(100),lastname varchar(20), father_name
varchar(100),mother_name varchar(100),
guardian_name varchar(100), sex varchar(6), dob date)")

curobj.execute("create table if not exists voterdetails(vid int


primary key,phoneno char(10), emailid varchar(100), aadharid
char(15), 10thmarksheet varchar(3),12thmarksheet varchar(3),
address varchar(200),pincode varchar(10), disability varchar(3),
application_submitted varchar(3))")
print('created')

def reg3():
while True:
print(' \t \t VOTER REGISTRATION \t \t')
name=input("enter voter's first name:")
lname=input("enter voter's last name:")
prn=input("enter father's name:")
mrn=input("enter mother's name:")
lg=input("enter legal guardian's name:")
s=input('enter sex(m/f/o):')
dob=input('enter date of birth(yyyy-mm-dd):')
while True:
no=input('enter the phone number:')
if len(no)==10 and no.isdigit():
break
em=input('enter email id:')
ad=input('enter aadhar id(xxxx xxxx xxxx):')
x=input('is 10th marksheet submitted?(yes/no):')
xii=input('is 12th marksheet submitted?(yes/no):')
add=input('enter your address:')
pin=input('enter your pincode:')
dis=input('enter disability if any(yes/no):')
ap=input('is the application form submitted?(yes/no):')
if ap=='yes':
print('Registered')
v=random.randint(100000,10000000)
else:
print('Not registered')
curobj.execute("insert into
voter(vid,vname,lastname,father_name,mother_name,guardian_na
me,sex, dob) values
({},'{}','{}','{}','{}','{}','{}','{}')".format(v,name,lname,prn,mrn,lg,s
,dob))
conobj.commit()
curobj.execute("insert into voterdetails(vid,phoneno,emailid,
aadharid,10thmarksheet,12thmarksheet,address,pincode,disability,
application_submitted)
values({},'{}','{}','{}','{}','{}','{}','{}','{}','{}')".format(v,no,em,ad,
x,xii,add,pin,dis,ap))
conobj.commit()
duwtc=input("duwtc(yes/no):")
if duwtc=='no':
break

#election-module6
from tabulate import tabulate
import matplotlib.pyplot as plt
import mysql.connector as mc
conobj=mc.connect(host='localhost',user='root',passwd='Student@
123',database='admin')
curobj=conobj.cursor()

def reg4():
while True:
print('\n MENU\n')
print()
print('1.Voterid Check')
print('2.Candidateid Check')
print('3.Election')
print('4.Voting Results')
print()
ch=int(input('choose a valid option from the above
(1,2,3,4):'))
print()
if ch==1:
vid=int(input("Enter your voter's id:"))
curobj.execute("select * from voter;")
data=curobj.fetchall()
for i in data:
if i[0]==vid:
print("You are valid voter")
break
else:
print("You Are Not Registered")

elif ch==2:
cid=int(input("Enter your candidate id:"))
curobj.execute("select * from candidateid;")
data=curobj.fetchall()
for i in data:
if i[0]==cid:
print("You are valid candidate")
break
else:
print("You Are Not Registered")

elif ch==3:
vid=int(input("Enter your voter's id:"))
curobj.execute("select * from voter;")
data=curobj.fetchall()
for i in data:
if i[0]==vid:
print("You are valid voter")
curobj.execute('select candidate_id,candidate_name,
party from candidateid')
data=curobj.fetchall()
print(tabulate(data,headers=['candidate_id','candidate_name','party'
]))

v=int(input("enter the candidate's id you prefer to vote:"))


curobj.execute("select total_votes from election where
candidate_id={}".format(v))
dat1=curobj.fetchone()
c=int(dat1[0])+1
curobj.execute("update election set total_votes={}
where candidate_id={}".format(c,v))
conobj.commit()
break
else:
print("You Are Not Registered")

elif ch==4:
print("\n ELECTION'S REPORT\n")
curobj.execute("select * from election")
data=curobj.fetchall()
print(tabulate(data,headers=['candidate id','Total Votes']))
x=[]
y=[]
for i in data:
x.append(str(i[0]))
y.append(i[1])
plt.title("ELECTION'S REPORT")
plt.xlabel('candidate id')
plt.bar(x,y,color='cyan',width=0.25)
plt.xticks(x)
plt.show()
print()
d=input("duwtc(y/n):")
if d=='n':
break
print()
reg4()
OUTPUT:
MySQL Tables:
BIBLIOGRAPHY

• Sumita Arora –Class 11 and 12


Computer Science Textbook.

You might also like