Professional Documents
Culture Documents
ERODE-638011
Developed by:
BHUMIKA KOCHAR.P
(Register No :)
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
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 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
1. Problem Definition 6
2. Problem Analysis 8
5. Source Code 12
6. Output 24
7. Bibliography 43
CONTENTS
• Problem Definition
• Problem Analysis
• 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.
•
•
• Hardware:
• Software:
#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)")
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))
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'
]))
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