Coding challenge 2

by Mahadevan Sivasubramanian

JavaScript

var scoreJohn = (89 + 120 + 103) / 3;
var scoreMike = (116 + 94 + 123) / 3;
var scoreMarry = (97 + 134 + 105) / 3;

console.log(scoreJohn, scoreMike, scoreMarry);

if (scoreJohn > scoreMike && scoreJohn > scoreMarry) {
  console.log('John\'s wins with the ' + scoreJohn + ' points');
} else if (scoreMike > scoreJohn && scoreMike > scoreMarry) {
  console.log('mike\'s wins with the ' + scoreMike + ' points');
} else if (scoreMarry > scoreJohn && scoreMarry > scoreMike) {
  console.log('Marry\'s wins with the ' + scoreMarry + ' points');
} else {
  console.log('score Draw');
}



/*if (scoreJohn > scoreMike) {
  console.log('John\'s wins with the ' + scoreJohn + ' points');
} else if (scoreMike > scoreJohn) {
  console.log('mike\'s wins with the ' + scoreMike + ' points');
} else {
  console.log('Match Draw');
}*/