-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchallenge_3.html
25 lines (24 loc) · 1.1 KB
/
challenge_3.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>JS Basics: Coding Challenge III</title>
</head>
<body>
<h1>Coding Challenge III</h1>
<p>
John and his family went on a holiday and went to 3 different restaurants. The bills were $124, $48 and $268. <br/>
To tip the waiter a fair amount, John created a simple tip calculator (as a function). He likes to tip 20% of the bill when the bill is less than $50, 15% when the bill is between $50 and $200, and 10% if the bill is more than $200. <br/>
In the end, John would like to have 2 arrays:<br/>
<ol>
<li>Containing all three tips (one for each bill).</li>
<li>Containing all three final paid amounts (bill + tip).</li>
</ol>
(NOTE: To calculate 20% of a value, simply multiply it with 20/100 = 0.2) <br/>
GOOD LUCK! 😀
</p>
<p><em>Check the developer console for the log</em></p>
<script src="./scripts/challenge_3.js" type="text/javascript"></script>
</body>
</html>