Me and 4 of my friends live together in a flat. I, Pradyumn live alone in one room, and the other four live together as pairs in two other rooms. All of our rooms have ACs and the bill in the State of Tamil Nadu is quite high. All of us have uneven usage and it feels wrong to distribute the bill evenly. So we installed meters for the three AC's and had to devise a formula to distribute the bill according to the usage of the three meters.
Before you begin, make sure you have Python installed. Additionally, you need to install the `tkinter` module, which is usually included with Python.
pip install tk
Clone the repository and navigate to the project folder.
git clone https://github.com/Onaga08/Bill-Divider.git
cd Bill-Divider
To run the program
python main.py
Underlying Math
Total Units: 100
Total Bill : 1000/-
m1 : 50 units
m2: 100 units
m3: 200 units
Now, we find per unit cost => (Total Bill/ Total Units) => (1000/10) => 10 Rs/unit (avg)
We multiply this per unit cost with the cost of all the meters to find out how much each of the ACs have consumed.
Accordingly we divide this among five roommates.
Note - As I live alone in one of the rooms, I get to pay the whole cost of m3.
The remaining cost => Total Bill - (Cost of all three AC) is divided amongst five people and added to give the final amount each of has to pay.
- Five roomates and their names
- m1 divided between first two roomates.
- m2 divides between third and fourth roomates
- m3 taken up fully by the fifth roomate
- Remaining bill divided between all five roomates
- main.py is the main runnable file. Output is a GUI module designed using Tkinter module in python.
- function.py is the helper file