-
Notifications
You must be signed in to change notification settings - Fork 0
/
reservations.html
83 lines (67 loc) · 1.59 KB
/
reservations.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<html>
<head>
<title>Javascript Bare</title>
</head>
<body>
<script type="text/javascript">
var name1 = "camilo";
var name2 = "monica";
var name3 = "gilbert";
var res1 = false;
var res2 = false;
var res3 = false;
while (true) {
var name = prompt("What name is your reservation under?");
if (name === name1) {
if (res1 === false) {
console.log("Welcome to the Food Palace!");
res1 = true;
break;
} else {
console.log("Sorry. That reservation is already claimed");
break;
}
} else if (name === name2) {
if (res2 === false) {
console.log("Welcome to the Food Palace!");
res2 = true;
break;
} else {
console.log("Sorry. That reservation is already claimed");
break;
}
} else if (name === name3) {
if (res3 === false) {
console.log("Welcome to the Food Palace!");
res3 = true;
break;
} else {
console.log("Sorry. That reservation is already claimed");
break;
}
} else {
console.log("Sorry. The is no reservation under that name.")
break;
}
if (name === 'exit') {
break;
}
}
// var reservations = []
// var newReservation = function(name) {
// reservations.push(name);
// };
// var askName = function() {
// var userName = prompt("Good Evening! Under what name is your reservation under?");
// newReservation(userName);
// console.log(reservations);
// }
// askName();
// var findReservation = function() {
// for(var i = 0; i < reservations.length; i++) {
// console.log(reservations[i]);
// };
// }
</script>
</body>
</html>