Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Part-1/challenge.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
// Good Luck! You got this 💪🏾
// Write your code here.

var bill = prompt("Enter bill amount ?");

var tip;

if (bill >= 50 && bill <= 300) {
tip = bill * 0.15;
console.log("tip for 15%", tip);
} else {
tip = bill * 0.2;
console.log("tip for 20%", tip);
}

var total = bill + tip;

console.log(`the bill was ${bill} , the tip ${tip}, and the value is ${total}`);
12 changes: 12 additions & 0 deletions Part-1/tip.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tipe</title>
</head>
<body></body>
</html>

<script src="./challenge.js"></script>