Find the caterer
Description:
You need to hire a catering company out of three for lunch in a birthday party. The first caterer offers only a basic buffet which costs $15 per person. The second one has an economy buffet at $20 and the third one has a premium buffet at $30. The third one gives a 20% discount if the number of persons to be served is greater than 60. You want to spend the maximum that fits into the budget.
find_caterer(budget, people) is the function which takes two arguments denoting the budget in $ and the number of people. Return 1, 2 or 3 for the three caterers as per the above criteria. Return -1 if there are no people or the budget is lower than the cost of buffets from the first caterer.
For example,
find_caterer(400, 25) will return 1.
find_caterer(200, 9) will return 2.
find_caterer(300, 9) will return 3 and so on.
Goodluck :)
Check my other katas:
Similar Kata:
Stats:
Created | Feb 11, 2018 |
Warriors Trained | 3 |
Total Skips | 0 |
Total Code Submissions | 20 |
Total Times Completed | 2 |
Python Completions | 2 |
Total Stars | 1 |
% of votes with a positive feedback rating | 0% of 0 |
Total "Very Satisfied" Votes | 0 |
Total "Somewhat Satisfied" Votes | 0 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 1 |
Average Assessed Rank | 8 kyu |
Highest Assessed Rank | 8 kyu |
Lowest Assessed Rank | 8 kyu |