-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJS Trial.html
38 lines (27 loc) · 948 Bytes
/
JS Trial.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
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<head>
<title>
Calculator
</title>
<body>
<script>
let pls = 15; //Plastic per kg
let crd = 15; //Cardboard per kg
let ppr = 20; //Paper per kg
var type = window.prompt("Select waste type 1 for Plastic, 2 for Cardboard, 3 for Paper? ");
var wght = window.prompt("Enter weight (note that this will be calculated automatically in the machine) ");
var phon = window.prompt("Enter email address associated with your account ")
if (type == '1') {
var amt = pls * wght;
}
else if (type == '2') {
var amt = crd * wght;
}
else if (type == '3') {
var amt = ppr * wght;
}
alert(amt)
alert("Rupees will be added to your account!")
</script>
</body>
</head>