write a program in diving competitions, each jump is assessed by seven judges who give points on a scale from 0 to 10. The point for each jump are calculated as follows: Ignore the highest and lowest scores given by the judges. Then calculate the average of the remaining five scores. The points for the jump are then calculated by multiplying the average obtained by 3 and then by a figure corresponding to the level of difficulty of the jump. Write a program that first inputs the level of difficulty of the jump, and then the scores given by the seven judges. The program should calculate and display the points for the jump

## All 3 Replies

Help, perhaps - do your homework, no.

Ask specific questions. Post the code you have started with and describe what you are having trouble with.

Rofl at least he's being rly honest and straightforward about what he's asking for ;)

We definitely want to help you out, but we want you to first try it out yourself. If you get stuck, post your issue and code here and we'll help -- but we want to see you first make an attempt.

write a program in diving competitions, each jump is assessed by seven judges who give points on a scale from 0 to 10. The point for each jump are calculated as follows: Ignore the highest and lowest scores given by the judges. Then calculate the average of the remaining five scores. The points for the jump are then calculated by multiplying the average obtained by 3 and then by a figure corresponding to the level of difficulty of the jump. Write a program that first inputs the level of difficulty of the jump, and then the scores given by the seven judges. The program should calculate and display the points for the jump

ok here is wat i hav done:

``````package divingcom;

import javax.swing.JOptionPane;

/**
*
* @author cis15
*/
public class Main{

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here

String pt1,pt2,pt3,pt4,pt5,pt6,pt7,dif;
float diff=0.0f;
float score1=0f;
float score2=0f;
float score3=0f;
float score4=0f;
float score5=0f;
float score6=0f;
float score7=0f;
float total=0f;
float sum=0f, avg=0f, max=0f,min=0f;

dif=JOptionPane.showInputDialog("Please enter the level of difficulty");
pt1=JOptionPane.showInputDialog("Enter the first score: ");
pt2=JOptionPane.showInputDialog("Enter the second score: ");
pt3=JOptionPane.showInputDialog("Enter the third score: ");
pt4=JOptionPane.showInputDialog("Enter the fourth score: ");
pt5=JOptionPane.showInputDialog("Enter the fifth score: ");
pt6=JOptionPane.showInputDialog("Enter the sixth score: ");
pt7=JOptionPane.showInputDialog("Enter the seventh score: ");

diff =Float.parseFloat(dif);
score1=Float.parseFloat(pt1);
score2=Float.parseFloat(pt2);
score3=Float.parseFloat(pt3);
score4=Float.parseFloat(pt4);
score5=Float.parseFloat(pt5);
score6=Float.parseFloat(pt6);
score7=Float.parseFloat(pt7);

max =Math.max(score1,Math.max(score2,Math.max(score3,Math.max(score4,Math.max(score5,Math.max(score6,score7))))));
min =Math.min(score1,Math.min(score2,Math.min(score3,Math.min(score4,Math.min(score5,Math.min(score6,score7))))));
sum=score1+score2+score3+score4+score5+score6+score7;
avg = (sum-(max+min))/5;
total=avg*(3*diff);

}

}
``````

still need to display average and total points .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.