PHP Classes / Calculadora Escons

Calculate elected seats using D'Hondt method

Calculadora Escons PHP Class

This class can be used to calculate the number of seats assigned to a party upon election results using the D'Hondt method. It takes as parameters the number of available seats and an associative array that relates each party with the votes they received. The class distributes the available seats using the D'Hondt method and returns an associative arrays that relates each party with the number of assigned seats that they got. The code and the comments are in Catalan.

Similar PHP Classes

Search in PHP Classes

Filter by tags