-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
27 lines (21 loc) · 1.79 KB
/
main.js
File metadata and controls
27 lines (21 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Dinner with Anna-Marie
// Welcome, food lover! You are joining Anna-Marie later today, alongside some of your fellow Bootcampers, at a Pie restaurant.
// You will need to order ahead, because there are so many of you. But you aren't sure how many will turn up - it will be at least 10 Bootcampers, but not more than 50.
// The extra trendy restauraunt never knows exactly how big their pies will be until they come out of the oven.
// Sometimes, they make small pies, which will be sliced just once. Other times, the bigger pies will be sliced 5 times.
// You know that one slice will be enough for one hungry BootCamper and you can only order whole pies.
// At the last minute, you receive a call from Chris, asking if he, Faisal and Nadeem can come too. But you already ordered the pies!
// Work out if there are enough slices left over for them to come too.
// Anna-Marie gets a whole pie to herself, because she is a legend - so no need to worry about her!
// EXAMPLE:
// There are 50 Bootcampers and the large pies are cut into 6 slices.
// So you would need 9 whole pies to feed everybody, and there are 4 slices left over, so Chris, Faisal and Nadeem can eat too!
// Rules:
// You need to know if you have too few or too many bootcampers turned up, so your formula should throw an error if there are less than 10, or more than 50 Bootcampers.
// The pies will each be sliced into 2,3,4,5, or 6 pieces. So throw an error if the pie chef messed up the slicing.
// Your should have two values returned in an array: The number of pies, as an integer. And a boolean value, for whether Chris, Faisal and Nadeem can join too.
// The return has been provided for you, easy as Pie!
export function whoAteAllThePies(bootcampers, slices) {
// Code goes here, pie warrior
return [pies, canChrisFaisalNadeemComeToo];
}