I am making a budget calculator program. In it, the user will select the importance of food, housing, comfort from an IMPORTANCE scale of 1 - 5. After that they will provide a budget.I will divide the budget based on how important each thing is for them and display it to them.
I'm confused how the math behind this will work. So it the user has a budget of 1000, and then chooses Food Importance = 4, Housing Importance = 2, Comfort Importance = 5. How do I divide the 1000 so that it dives accordingly without going above or below 1000.