Tegegn Wukianos Logo Tegegn Wukianos

C++ • DATA STRUCTURES • CLI ARCHITECTURE

Departmental Voting Management System

A console application developed for Wolaita Sodo University's Fundamentals of Programming curriculum, demonstrating structured records, voter identity verification, and tallying logic.

Language & Standard C++ (C++11 / C++17 Compatible)
Core Concepts Structs, Linear Search, Validation, CLI
Academic Context WSU Fundamentals of Programming II

1. The Academic Challenge & Objectives

As part of the Computer Science curriculum at Wolaita Sodo University (Group 7, Fundamentals of Programming II), the task was to architect an automated voting system from scratch in pure C++. The primary objective was to replace paper ballots in departmental student representative elections with a structured, fraud-resistant digital console pipeline.

Key project constraints included:

2. Data Structures & Architectural Design

The system is built upon composite data structures that encapsulate entity states directly in memory:

struct department {
    int id;
    string dept_name;
    int vote_count;
};

struct user {
    int id;
    string name;
    bool is_voted = false;
};

By coupling each voter record with a boolean is_voted flag, state transitions are maintained throughout the execution lifecycle without needing external database overhead.

Modular Function Architecture:

3. Fraud Prevention & Input Validation

Voting integrity is enforced through two critical defensive mechanisms implemented directly in the vote casting routine:

A. Voter ID Verification

When an ID is entered, the system performs a bounded linear search over the array of registered students. If the ID does not match an entry in the pre-configured roll, access is immediately denied with an informative error message.

B. Double-Vote Mitigation

Before any ballot options are presented, the student's record is checked for users_list[found_index].is_voted. If already marked true, the transaction is rejected:

Defensive Verification Logic:

if (users_list[found_index].is_voted) { cout << "Sorry " << users_list[found_index].name << ", you have already voted!\n"; return; }

C. Ballot Boundary Protection

User selections outside the allowable index range (choice < 1 || choice > 5) are safely discarded, preventing array out-of-bounds memory access or segmentation faults.

4. Educational Impact & Algorithmic Takeaways

O(1)
Vote Tally Complexity
100%
Duplicate Prevention
Zero
External Dependencies

This project served as a foundational milestone in mastering core systems programming concepts in C++: static memory layout, procedural decomposition, pointer/array mechanics, and defensive input processing. The complete source code is publicly accessible on GitHub at tegegndev/cpp-voting-management-system.