Instructor: Welcome to the next coding challenge.
In this one you're gonna build a very simple tip calculator.
So John and his family went on a holiday
and went to three different restaurants,
and the bills were 124, 48, and 268 dollars.
Now to tip the waiter a fair amount,
John created a simple tip calculator as a function.
And the way that John calculates his tips,
is that he likes to tip 20 percent of the bill
when then bill is less than 50 dollars,
15 percent when the bill is between 50 and 200 dollars,
and 10 percent of the bill if it is more than 200 dollars,
and this may not make a lot of sense,
but this is just for this small exercise
so we have some more stuff to do in our function, okay.
So in the end, John would like to have two arrays
as the end results.
So one containing all three tips, so one for each bill,
and then one containing all three final paid amounts,
and with paid amounts, I mean the bill plus the paid tip.
Okay, so we want a function that calculates the tip,
and then we want two arrays,
one with just the tips and one with tips plus the bill.
Okay, and if you're not sure how to calculate a percentage,
for example if you want to take 20 percent of a value,
you have to simply multiply that value by 0.2,
which is 20 divided by 100, okay, so that's very simple.
Alright, so I hope you manage to do this,
this will be a good challenge for you
to use most of the stuff that we talked about
up until this point.
So give it some time, try it out,
and then I'll see you in the next video with the solution.
Good luck.