Draft

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:

Alphabetically ordered

Case-sensitive!

Find Nearest square number

Not prime numbers

Fundamentals

Similar Kata:

Stats:

CreatedFeb 11, 2018
Warriors Trained3
Total Skips0
Total Code Submissions20
Total Times Completed2
Python Completions2
Total Stars1
% of votes with a positive feedback rating0% of 0
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes0
Total Rank Assessments1
Average Assessed Rank
8 kyu
Highest Assessed Rank
8 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • riyakayal Avatar
Ad