This repository contains a web-based implementation of a runoff election system, originally inspired by the "Runoff" problem set from CS50. The website allows users to simulate a ranked-choice voting process where they can input candidate names and their preferences, and the system calculates the winner based on the ranked-choice voting algorithm.
- Input form for users to enter candidate names and vote preferences.
- Calculation of election winner using the ranked-choice voting method.
- Visual representation of the voting process and outcome.
- Responsive design with Bootstrap styling for optimal viewing on various devices.
In a runoff election, voters rank candidates in order of preference. The counting process involves several steps:
- Vote Collection: Users input candidate names and rank them according to their preferences. Each voter's ballot contains a ranked list of candidates.
- Vote Tabulation: Initially, the votes are counted by tallying the first choice preferences of each voter. If any candidate receives more than 50% of the first-choice votes, they are declared the winner.
- Elimination of Candidates: If no candidate has a majority, the candidate with the fewest first-choice votes is eliminated from the race. Their votes are transferred to the next ranked candidate on each ballot.
- Recounting: The votes are recounted, and the process continues until a candidate achieves a majority of votes.
This ranked-choice voting method ensures that the eventual winner is preferred by the majority of voters.
- Clone the repository to your local machine.
- Open the
index.htmlfile in your web browser. - Enter the names of candidates and submit the ballot with your preferences.
- View the election process and the eventual winner displayed on the website.
- HTML5
- CSS3
- JavaScript
- Bootstrap
This project was developed by Sarvesh Shahane. It was inspired by the "Runoff" problem set from CS50, Harvard University's introduction to computer science course.