MCPcopy Create free account
hub / github.com/LinkedInLearning/javascript-essential-training-2832077 / tipCalculator

Function tipCalculator

08_07/script.js:6–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4 */
5
6const tipCalculator = () => {
7 let sum = 29.95;
8 let percentage = 18;
9 let tip = sum * (percentage / 100);
10 let total = sum + tip;
11 console.log(`
12 Sum before tip: ${sum}
13 Tip percentage: ${percentage}%
14 Tip: ${tip.toFixed(2)}
15 Total: ${total.toFixed(2)}
16`);
17};
18
19tipCalculator();

Callers 1

script.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected