Pps Project A.Ruthvik 6669
Pps Project A.Ruthvik 6669
Report on
ELECTION VOTING
BACHELOR OF TECHNOLOGY
In
DEPARTMENT OF FRESHMEN ENGINEERING
By
ANJUKANDI RUTHVIK
ROLL NO: - 24K81A6669
Under the esteemed guidance of
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).
• INTRODUCTION
• LITERATURE SURVEY
• SYSTEM ANALYSIS
o Existing System
o Proposed System
o Hardware Requirements
o Software Requirements
• FLOWCHART AND ALGORITHM
• SYSTEM IMPLEMENTATION
• SYSTEM TESTING
• OUTPUT SCREENS
• CONCLUSION
• FUTURE ENHANCEMENT
• REFERENCES
INTRODUCTION
In C programming, an election voting system can be implemented to facilitate the casting and
counting of votes in a structured manner. This involves creating a program that manages a list
of candidates, allows voters to make selections, and tallies the votes to declare the election
results. The program typically includes functions for displaying the list of candidates, casting
votes, and presenting the final results. While a basic C program can serve as a starting point
for educational purposes, a comprehensive election voting system would necessitate more
advanced features, such as secure user authentication, data storage, and integrity measures to
ensure the reliability and fairness of the electoral process. Developing a robust election
system requires attention to detail, adherence to legal requirements, and consideration of
security aspects to maintain the integrity of the voting process.
Common control statements include "if" statements for conditional branching. "Switch"
statements are also employed to handle multiple possible outcomes efficiently. Loops, such as
"for" and "while" loops, are crucial for iterating through candidate lists or processing votes
until a specified condition is met.
Arithmetic operators, such as addition (+), subtraction (-), multiplication (*), and division (/),
are employed for numerical calculations. Relational operators like equality (==) or inequality
(!=) are utilized to compare. Logical operators such as AND (&&) and OR (||) are valuable
for combining multiple conditions. Assignment operators, including (=), are pivotal for
updating variables with new values. Conditional (ternary) operators offer concise ways to
express conditional logic in a single line, streamlining code readability.
ARRAYS, STRINGS, STRUCTRES AND UNIONS THAT ARE USED IN THIS PROJECT
ARRAYS: -
typedef struct
char name[50];
int votes;
Candidate;
SRTINGS:-
char candidateName[50];
scanf("%s", candidateName);
STRUCTRES:-
typedef struct
char name[50];
int votes;
Candidate;
typedef union {
int integerVote;
float floatVote;
char charVote;
Vote;
LITERATURE SURVEY OR BACKGROUND INFORMATION
C is a general-purpose, high-level programming language created by Dennis Ritchie at Bell
Labs in the early 1970s. It evolved from an earlier language called B and played a crucial role
in the development of operating systems, particularly the UNIX operating system. C is
known for its efficiency, portability, and low-level programming capabilities. It provides a
structured programming approach and supports both procedural and modular programming
paradigms. C has influenced many other programming languages, and its simplicity, power,
and versatility have contributed to its enduring popularity. The development of C led to the
creation of C++, an object-oriented extension, and the C language remains an important
foundation for modern programming, serving as the basis for languages like
C#, Java, and more.
In C programming, tokens are the smallest units in the source code, representing individual
elements that the compiler recognizes. Tokens are building blocks that make up the syntax of
a C program. The key types of tokens in C include identifiers, keywords, constants, operators,
and special symbols.
Here's a brief explanation of these token types and how they might be used in the context of
an election voting system:
Identifiers: Identifiers are names given to various program elements, such as variables,
functions, or labels. In an election voting system, identifiers could include names like
candidateName or totalVotes.
Keywords: Keywords are reserved words with specific meanings in the C language.
Examples include int, char, if, and for. Keywords play a critical role in defining the structure
and logic of a C program.
Constants: Constants are unchanging values used in a program. Numeric constants (e.g., 1,
2.5), character constants (e.g., 'A'), and string constants (e.g., "Election Day") could be used
in an election voting system to represent candidate votes, election dates, or other fixed values.
Operators: Operators perform operations on variables and values. Arithmetic operators (+, -,
*, /) can be used for calculating vote totals, while relational operators (==, !=, <, >) can be
used to compare vote counts.
Special Symbols: Special symbols include punctuation and other symbols used to structure
the program. Examples include braces {}, parentheses (), and semicolons ;. These symbols
are crucial for defining blocks of code, function parameters, and separating statements.
int: The int data type is used to represent integer values. In an election voting system, it could
be used to store the number of votes cast for a candidate or the total number of voters.
int totalVotes;
char: The char data type is used for individual characters. It can be utilized to store characters
such as candidate initials or party affiliations.
char partyAffiliation;
float or double: These data types are used to represent floating-point numbers, which can be
useful for storing percentages or other fractional values related to the election.
float votePercentage;
struct: The struct keyword allows the creation of user-defined data types, which can be handy
for organizing related pieces of information. In an election voting system, a structure might
be used to represent a candidate.
struct Candidate {
char name[50];
int votes;
};
enum: The enum keyword allows the creation of enumerations, which provide a way to
define named integer constants. This can be useful for representing various states or choices
in the election system.
enum ElectionState {
NOT_STARTED,
IN_PROGRESS,
COMPLETED
};
programming language has been used to develop a wide range of applications across various
domains due to its efficiency, portability, and versatility. Here are some common types of
applications that have been developed in C:
Operating Systems: C was initially developed for implementing the UNIX operating system.
Many operating systems, including Windows and Linux, have components written in C for
performance reasons.
Compilers and Interpreters: The development of compilers and interpreters for other
programming languages often involves the use of C. Popular languages like Python, Ruby,
and Perl have components written in C.
Database Systems: Many database management systems, including MySQL and PostgreSQL,
use C for core functionality due to its efficiency in handling low-level operations.
Web Development: While higher-level languages like JavaScript and Python are more
commonly used in web development, C can be involved in the backend of web servers and
infrastructure.
System Utilities: Many system utilities and tools, such as file management programs,
command-line utilities, and system monitoring tools, are written in C.
Real-time Systems: C is favored in real-time systems due to its ability to manage hardware
resources efficiently. Applications include aerospace systems, medical devices, and industrial
control systems.
The following system has many problems as it has minimum security and process of
registration is really slow. And this process has many other disadvantages of security.
The following system when compared to the present system has higher security and has high
applications towards the calculations of votes based on the population of state and calculates
the minimum average and gives the result. The following system also has high amount of
speed towards the calculation as it has modern coding installed.
3.SOFTWARE REQUIREMENTS
• Programming Language
• C Programming Language
• Database Management System (DBMS)
• SQLite, MySQL, PostgreSQL
• User Interface
• Curses Library or Simple GUI Libraries
• Security Libraries
• OpenSSL or Libsodium
• Network Communication
• Sockets Programming
• Authentication Mechanisms
• Libraries for Password Hashing
• Logging and Auditing
• Logging Libraries
• Testing Frameworks
• Unit Testing Frameworks (e.g., Unity for C)
• System Monitoring
• Custom or Existing Monitoring Tool
• Cryptography Tools (Optional)
• GPG (GNU Privacy Guard)
• Version Control
• Git
• Build System
• Make or CMake
• Documentation Tools
• Doxygen or similar
• Compliance with Standards
• Coding Standards and Guidelines
• Integrated Development Environment (IDE)
• Cross-Platform Libraries
4.HARDWARE REQUIREMENTS
• Server Infrastructure
• Database Server
• Network Infrastructure
• Client Devices
• Voting terminals or devices
• Touchscreen displays, input devices
• Security Hardware
• Hardware security modules (HSMs)
• Backup and Redundancy
• Monitoring and Logging
• Power Supply
• Scalability
• Compliance Devices
SYSTEM ARCHITECTRE
The above output was taken from an online compiler from the website
programiz.com
OUTPUT 2:-
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.
CONCLUTION
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 todays 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.
REFERENCES
• https://www.nationalgeographic.org/topics/resource-library-voting-process/