0% found this document useful (0 votes)
7 views12 pages

Voting - System - Presentation 67

The document describes a simple voting system implemented in C, featuring user registration, voting, and admin controls for results management. It outlines the technologies used, code structure, and provides examples of key functions like user registration and login. The system is designed for small-scale scenarios and has potential for future enhancements such as preventing duplicate votes and integrating a GUI.

Uploaded by

bdsingh9040
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)
7 views12 pages

Voting - System - Presentation 67

The document describes a simple voting system implemented in C, featuring user registration, voting, and admin controls for results management. It outlines the technologies used, code structure, and provides examples of key functions like user registration and login. The system is designed for small-scale scenarios and has potential for future enhancements such as preventing duplicate votes and integrating a GUI.

Uploaded by

bdsingh9040
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/ 12

Voting System in C

Introduction

A simple voting system implemented in C.

Allows user registration, voting, and admin-


controlled results.

Designed for small-scale voting scenarios.


Features of User Registration

the Voting
System User Login and Voting

Admin Login &


Controls

Vote Counting &


Displaying Results

Resetting Votes
(Admin Only)
Technologies Used

Programming Language: C

Development Environment: Code::Blocks, Turbo


C++, VS Code

Uses Arrays & String Handling in C


Flowchart of the
System

• Here is the system


flowchart showing the
process of registration,
voting, and result viewing.
Code Structure &
Explanation
• registerUser(): Registers new users
• loginUser(): Authenticates users
• castVote(): Allows voting
• viewResults(): Shows results
• adminMenu(): Admin controls
• main(): Controls program execution
Code Piece Example
• Below is an example of the User Registration function in
C:
int registerUser() {
if (userCount >= MAX_USERS) return 0;
scanf("%s", users[userCount]);
userCount++;
return 1;
}
The registerUser() function is responsible for registering a
new user by adding their username to the users array.
No Username Length Restriction
Below is an example of the User Login Function in
C:

int loginUser(char username[]) {


for (int i = 0; i < userCount; i++) {
if (strcmp(users[i], username) == 0) {
return i;
}
}
return -1; // User not found
}

Purpose: Checks if a user exists in the system and returns their


index if found.
Limitation: No password authentication.
Advantages & Limitations
Simple and easy-to-use.
Secure with admin authentication.
Can be expanded further.
No duplicate vote prevention.
Uses plain-text admin password.
Limited to console-based interface.
• Prevent duplicate voting.
• GUI using C++ or Python.
Possible
• Database integration for
Future
permanent storage.
Enhancements
• Real-time vote count
updates.
Conclusion & Demo

This Voting System in C is a basic console-based


application.

Future improvements can make it more secure


and user-friendly.

Below is a demonstration of the system in action.


Q&A
• Any Questions?

You might also like