Budget app conception

How to calculate the percentage:
I am confused on how to calculate the percentage stated in the question: I thought it would be the total amount of withdrawal divided by the amount of total deposit, but when I hit the Run button, the test showed I was wrong and I noticed a whole different spend-chart far from what I expected. How should I calculate the percentage?

Challenge: Budget App

Link to the challenge:

I would refer to this bit in the README.md file:

The chart should show the percentage spent in each category passed in to the function. The percentage spent should be calculated only with withdrawals and not with deposits. Down the left side of the chart should be labels 0 - 100.

In this sense, spending is solely based off category ledger withdrawals. The tests are looking for each category’s withdrawals as compared to the total withdrawals from all the categories passed to the function.

If I withdraw $10 to spend on breakfast and then withdraw another $20 to spend on school supplies, I’ve spent $30 on two categories of expenditures.

Thanks for the explanation. I have an inquiry: did you realize that from the expression (only with withdrawals), because as far as I saw, percentage as referred to the first time in the question is a general meaning and vague(doesn’t determine in respect to what)?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.