-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheightball.js
More file actions
31 lines (25 loc) · 778 Bytes
/
Copy patheightball.js
File metadata and controls
31 lines (25 loc) · 778 Bytes
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
let userName = 'J Kim';
userName ? console.log(`Hello, ${userName}!`) : console.log('Hello!');
let userQuestion = 'Could I become a web developer?';
console.log(`The user asked :${userQuestion}`);
let randomNumber = Math.floor(Math.random()*8);
let eightBall = '';
switch(randomNumber){
case 0 : eightBall ='It is certain';
break;
case 1 : eightBall = 'It is decidedly so';
break;
case 2 : eightBall = 'Reply hazy try again';
break;
case 3 : eightBall = 'Cannot predict now';
break;
case 4 : eightBall = 'Do not count on it';
break;
case 5 : eightBall = 'My sources say no';
break;
case 6 : eightBall = 'Outlook not so good';
break;
case 7 : eightBall = 'Signs point to yes';
break;
}
console.log(`The eight ball answered: ${eightBall}`);