Write a Program: Competition Score
Your goal is to create a program that will determine the average score for an
athlete in a competition. There are 10 judges who each award a score between 0
and 10. The lowest and highest scores are thrown out, and the athlete’s score is
the average of the eight remaining scores.
You need to create a scorecard file in a text editor or type it into onlineGDB. The
scorecard should have the first and the last name of the athlete on the first line
and 10 space-separated numbers between 0 and 10 on the second line. The
numbers should have at most 1 digit after the decimal point.
let average = 0;
for (let i = 0; i < 10; i++) {
let foo = parseInt(prompt());
average += foo;
}
console.log(average/10);
Comments
Leave a comment