0% found this document useful (0 votes)
12 views13 pages

Final_pps_ruthvik_6669[1]

The document presents a project report on an Election Voting System developed using C programming, aimed at providing a secure and efficient electronic voting process. Key features include candidate registration, voter authentication, ballot casting, and result tabulation, all designed to ensure integrity and transparency in elections. The project serves as a practical application of programming concepts while emphasizing the importance of accessibility and reliability in democratic processes.

Uploaded by

appalabalaji5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views13 pages

Final_pps_ruthvik_6669[1]

The document presents a project report on an Election Voting System developed using C programming, aimed at providing a secure and efficient electronic voting process. Key features include candidate registration, voter authentication, ballot casting, and result tabulation, all designed to ensure integrity and transparency in elections. The project serves as a practical application of programming concepts while emphasizing the importance of accessibility and reliability in democratic processes.

Uploaded by

appalabalaji5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

A

Report on
ELECTION VOTING

PROGRAMMING FOR PROBLEM SOLVING PROJECT


Submitted in partial fulfilment of the requirements for
The Award of the degree of

BACHELOR OF TECHNOLOGY
In
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
(AI&ML)
By
ANJUKANDI RUTHVIK
ROLL NO: - 24K81A6669
Under the esteemed guidance of

Mrs. A. Lakshmi Teja


ASSISTANT PROFESSOR
BRANCH & SECTION: CSE(AI&ML)-B

DEPARTMENT OF FRESHMEN ENGINEERING


St. MARTIN’S ENGINEERING COLLEGE
UGC AUTONOMOUS
NBA & NAAC A+ Accredited
Dhulapally, Secunderabad – 500100

1
St. MARTIN’S ENGINEERING COLLEGE
UGC AUTONOMOUS
NBA & NAAC A+ Accredited
Dhulapally, Secunderabad – 500100

CERTIFICATE
This is to certify that the PROGRAMMING FOR PROBLEM SOLVING PROJECT
entitled “ELECTION VOTING” is a Bonafide record of independent work done by
ANJUKANDI RUTHVIK (24K81A6669) under my supervision and guidance,
submitted to St. MARTIN’S ENGINEERING COLLEGE, Hyderabad, in partial
fulfilment for the award of the Degree of Bachelor of Technology in COMPUTER
SCIENCE ENGINEERING (AI&ML).

Project Internal Guide Head of Department


Mrs. A. Lakshmi Teja Dr.R. Ranadheer Reddy
(Dept. of FME) (Professor and HOD)

…………………………….. …………………………………

Group Director
(Dr. P. SANTOSH KUMAR PATRA)

2
ABSTRACT
This C programming project focuses on the development of an Election Voting System,
providing a robust and efficient solution for conducting electronic voting processes. The
program encompasses key features such as candidate registration, voter authentication, ballot
casting, and result tabulation. Utilizing fundamental concepts of C programming, the system
employs data structures, file handling, and conditional statements to ensure the integrity and
security of the electoral process. The implementation follows a modular approach, promoting
code reusability and maintainability. This project serves as a practical illustration of how C
programming can be employed to address the complexities of election systems, balancing
simplicity and functionality while adhering to the principles of secure and transparent voting
processes.

3
CONTENTS

ABSTRACT 3

CHAPTER 1 - APPROACH 5

CHAPTER 2 - SYSTEM IMPLEMENTATION 6

CHAPTER 3 - COMPLETE PROGRAM 7-9

CHAPTER 4 - OUTPUT 10-11

CHAPTER 5 - CONCLUSION 12

CHAPTER 6 - FUTURE ENHANCEMENT 13

4
1. APPROACH

To design a C program for election voting, you can follow a simple approach that allows
multiple candidates, collects votes from users, and outputs the results. Here's an outline for
how you can structure your program:

Steps to Approach

1. Define the Problem Scope:

o You need to handle multiple candidates.

o Collect votes from multiple voters.

o Calculate and display the results.

o Ensure user input is valid (e.g., voters can’t vote more than once).

2. Define the Data Structures:

o Candidates: Store candidate names.

o Votes: Keep track of votes for each candidate.

3. Steps in the Program:

o Display a menu for voters to select a candidate.

o Register votes.

o Ensure that no one votes more than once (optional feature).

o After all voting is complete, calculate and display the results.

4. Flow Diagram:

o Initialize candidates and vote counts.

o Ask for the total number of voters.

o Collect each voter’s vote.

o Display results after all votes have been cast.

5
2. SYSTEM IMPLEMENTATION

To implement a full voting system in C, we can extend the previous basic program into a
more robust Election Voting System that includes the following features:

1. User Authentication: Allow voters to register and authenticate (prevent multiple


voting).
2. Dynamic Vote Counting: Handle multiple rounds of voting if necessary.
3. Persistent Storage: Store voter data and vote counts in files, so that votes persist
between sessions.
4. Admin Panel: Allow an admin to manage candidates, view results, and reset the
system if necessary.
5. Election Rounds: Handle cases where you want to hold multiple rounds of voting,
e.g., if a winner is not chosen outright.

This implementation will include:

• A file system to store votes and voter data.


• An admin interface to manage the election.
• User authentication to prevent duplicate voting.

Let’s break it down into sections.

System Requirements:

• Admin Management: Admin can add/remove candidates.


• Voter Authentication: Voters can register and vote only once.
• Results Calculation: At the end of voting, calculate and display the winner.

6
3. COMPLETE PROGRAM
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Define a structure for a candidate
typedef struct
{
char name[50];
int votes;
}
Candidate;
// Function to display the list of candidates
void displayCandidates(Candidate candidates[], int numCandidates) {
printf("Candidates:\n");
for (int i = 0; i < numCandidates; i++) {
printf("%d. %s\n", i + 1, candidates[i].name);
}
printf("\n");
}
// Function to cast a vote
void vote(Candidate candidates[], int numCandidates) {
int choice;
printf("Enter the number of your chosen candidate: ");
scanf("%d", &choice);
if (choice >= 1 && choice <= numCandidates) {
candidates[choice - 1].votes++;
printf("Vote cast successfully!\n");
} else
{
printf("Invalid choice. Please try again.\n");

7
}
}
// Function to display the election results
void displayResults(Candidate candidates[], int numCandidates) {
printf("Election Results:\n");
for (int i = 0; i < numCandidates; i++) {
printf("%s: %d votes\n", candidates[i].name, candidates[i].votes);
}
}
int main() {
int numCandidates;
printf("Enter the number of candidates: ");
canf("%d", &numCandidates);
// Allocate memory for the candidates
Candidate *candidates = (Candidate *)malloc(numCandidates * sizeof(Candidate));
// Get the names of the candidates
for (int i = 0; i < numCandidates; i++) {
printf("Enter the name of candidate %d: ", i + 1);
scanf("%s", candidates[i].name);
candidates[i].votes = 0;
}
int choice;
do
{
printf("\nElection Voting System\n");
printf("1. Display Candidates\n");
printf("2. Cast Vote\n");
printf("3. Display Results\n");
printf("4. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);
switch (choice)

8
{
case 1:
displayCandidates(candidates, numCandidates);
break;
case 2:
vote(candidates, numCandidates);
break;
case 3:
displayResults(candidates, numCandidates);
break;
case 4:
printf("Exiting the program. Thank you!\n");
break;
default:
printf("Invalid choice. Please try again.\n");
}
}
while (choice != 4);
// Free allocated memory
free(candidates);
return 0;
}

MODULES AND FUNCTIONS USED IN ELECTION VOTING PROCESS


displayMenu()
registerCandidates()
registerVoters()
castVote()
displayResults()
main()

9
4. OUTPUT
OUTPUT 1:-

OUTPUT 2:-

10
In the first output I took the no.of candidates as 5 and listed them as
1.ram
2. mahi
3.varma
4.mani
5.venkat
Then according to the program it asks about the no.of voters
It was listed as 5
Voter1
Number of the candidate you want to vote for: -
3
Vote cast successfully for Varma
In this manner I entered the data for 5 voters and got the final output as
1.ram: 2votes
2.mahi: 2votes
3.varma: 0votes
4.mani: 1votes
5.venkat: 0votes

As for the second output the no.of candidates was taken as 3 and the no.of voters as 2.

11
5. CONCLUSION

In conclusion, the integration of C programming in election voting systems plays a pivotal


role in fostering a transparent and efficient democratic process. By automating the voting
process, C programming ensures accuracy, minimizes errors, and expedites result tabulation.
The secure and tamper-resistant nature of C-coded election systems enhances the credibility
of electoral outcomes, instilling trust among citizens. Additionally, the accessibility features
embedded in C-programmed interfaces facilitate inclusive participation, catering to diverse
demographics. Overall, the utilization of C programming in election voting significantly
contributes to the democratic ethos by upholding fairness, reliability, and accessibility in the
electoral framework, thereby serving the broader interests of society.

12
6. FUTURE ENHANCEMENT

In this project of election voting process when compared to the modern way of coding
included it has high security and greater enhancement of a single person. In this way we can
maintain irregularities and maintain the errors to minimum. In this way in the future this code
will be in greater advantage since this program was developed using today’s modern
problems. As for the future enhancement the program allows to change the code accordingly
in case in case of any errors or enhancement in the code.

13

You might also like