In a gymnastic or diving competition,each contestant,s scoreis calculated by dro
ID: 3610263 • Letter: I
Question
In a gymnastic or diving competition,each contestant,s scoreis calculated by dropping the lowest and highest scores and thenadding the remaining scores.Write a program that allows the user toenter eight judges scores and then outputs the points received bythe contestant.Format your output with tow decimal places.A judgeawards points between 1 and 10, with 1 being the lowest and 10being the highest.For Examples,if the score are 9.0, 9.3, 9.2, 9.9,9.5, 9.5, 9.6, and 9.8, the contestant receives a total of 56.90points. In a gymnastic or diving competition,each contestant,s scoreis calculated by dropping the lowest and highest scores and thenadding the remaining scores.Write a program that allows the user toenter eight judges scores and then outputs the points received bythe contestant.Format your output with tow decimal places.A judgeawards points between 1 and 10, with 1 being the lowest and 10being the highest.For Examples,if the score are 9.0, 9.3, 9.2, 9.9,9.5, 9.5, 9.6, and 9.8, the contestant receives a total of 56.90points.Explanation / Answer
please rate - thanks import java.util.*; import java.text.*; public class competitionScore { public static void main(String args[]) {int i; double max=-100,min=500,sum=0; DecimalFormat twodecimal = newDecimalFormat("#0.00"); String formattednumber; Scanner in=new Scanner(System.in); double score[] = new double[8]; for(i = 0; i < 8; i++) {System.out.print("Enterscore " + (i+1) + ": "); score[i] =in.nextDouble(); if(score[i]10) {System.out.println("InvalidScore-reenter"); i--; } else {if(score[i]>max) max=score[i]; if(score[i]Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.