I am having trouble with this exercise, everything is running, but the answer is not following the question, as well with the response from the eight ball. Please help.
let userName = “Kaos”;
userName ? console.log(Hello ${userName}
) : console.log(“Hello!”);
let randomNumber2 = Math.floor(Math.random() * 3);
let userQuestion = ‘’;
switch (randomNumber2) {
case 0:
console.log(“Will I be rich and famous”);
break;
case 1:
console.log(“Will get that promotion”);
break;
case 2:
console.log(“Will I get a position in cybersecurity.”);
break;
default:
console.log(“Just give me an answer, you know what I am thinking”);
}
console.log(${userName} has asked: ${userQuestion}
);
let randomNumber = Math.floor(Math.random() * 8);
let eightBall = ‘’;
if (randomNumber === 0) {
console.log(“It is certain”);
} else if (randomNumber === 1) {
console.log(“It is decidedly so”);
} else if (randomNumber === 2) {
console.log(“Reply hazy try again”);
} else if (randomNumber === 3) {
console.log(“Cannot predict now”);
} else if (randomNumber === 4) {
console.log(“Do not count on it”);
} else if (randomNumber === 5) {
console.log(“My sources say no”);
} else if (randomNumber === 6) {
console.log(“Outlook not so good”);
} else if (randomNumber === 7) {
console.log(“Signs point to yes”);
} else {
console.log(“Sorry come back later”);
}
console.log(The Magic 8 Ball says, ${eightBall}.
);