Untitled
unknown
javascript
4 years ago
1.1 kB
11
Indexable
let test = Number(prompt("Question for Dolphins: Whats ur first score ?!"));
let test1 = Number(prompt("Question for Dolphins: Whats ur second score ?!"));
let test3 = Number(prompt("Question for Dolphins: Whats ur third score ?!"));
let DolphinsScoreAverage = (test+test1+test3)/3;
console.log(`Dolphin's score average is: ${DolphinsScoreAverage}`);
let koala1 = Number(prompt("Question for Koala's: Whats ur first score ?!"));
let koala2 = Number(prompt("Question for Koala's: Whats ur second score ?!"));
let koala3 = Number(prompt("Question for Koala's: Whats ur third score ?!"));
let KoalaScoreAverage = (koala1+koala2+koala3)/3;
console.log(`Koala's score average is: ${KoalaScoreAverage}`);
if((DolphinsScoreAverage&&KoalaScoreAverage)>100) {
if (DolphinsScoreAverage > KoalaScoreAverage) {
console.log("Dolphin's are the winners !! Congrats")
} else if (DolphinsScoreAverage === KoalaScoreAverage) {
console.log("It's a TIE")
} else {
console.log("Koalas's are the winners !! Congrats")
}
}else {
console.log("Score is under 100!")
}
Editor is loading...