Program that inputs a degree of difficulty

Assignment Help JAVA Programming
Reference no: EM13941282

In the sport of diving, seven judges award a score between 0 and 10, where each score may be a floating point value. The highest and lowest scores are thrown out and the remaining scores are added together. The sum is then multiplied by the degree of difficulty for that dive. The degree of difficulty ranges from 1.2 to 3.8 points. The total is then multiplied by 0.6 to determine the diver's score.

Write a computer program that inputs a degree of difficulty and seven judges' scores and outputs the overall score for that dive. The program should ensure that all inputs are within the allowable data ranges.

HINT:

Use an array to store the scores. Scan the array for the position of the largest and smallest values, then ignore these positions when computing the sum of the scores.

Consider the case where all judges give the diver the same score. In this case, the largest and smallest values will be the same. Make sure that your solution handles this case properly.

/**
* This program calculates the score for a contestant in diving.
* The highest and lowest scores are thrown out, the remaining are added
* together, and the sum multiplied by the degree of difficulty
* and 0.6.
* <P>
* This program uses an array to hold the seven scores, then
* scans the array for the position of the largest and smallest
* score. These positions are then ignored in computing the sum
* of the scores.
*/
import java.util.Scanner;

public class Diving {

public static void main(String[] args) {
double[] scores = new double[7];
int posMinScore, posMaxScore;
double sum = 0;
double difficulty;
double finalscore;

// --------------------------------
// ----- ENTER YOUR CODE HERE -----
// --------------------------------

// --------------------------------
// --------- END USER CODE --------
// --------------------------------

System.out.println("The diver's final score is " + finalscore);
}
}

Reference no: EM13941282

Questions Cloud

If the company reduces variable expenses : The variable expense per unit is $175 and fixed expenses are $100,000. If the company reduces variable expenses by $20 per unit and increases the fixed expenses by $10,000, the break-even point will DECREASE.
Explain all criminal behavior can be considered rational : Analyze the impact that individual's environment and/or genetics have on the individual's ability to make a free choice not to commit criminal acts.
Behaviour of gas producers and gas consumers : Critically assess the national gas access regime in Australia in terms of how it influences the behaviour of gas producers and gas consumers.
Target capital structure-what is the aftertax cost of debt : Mullineaux Corporation has a target capital structure of 65 percent common stock, 5 percent preferred stock, and 30 percent debt. Its cost of equity is 11 percent, the cost of preferred stock is 5 percent, and the pretax cost of debt is 7 percent. Wh..
Program that inputs a degree of difficulty : Write a computer program that inputs a degree of difficulty and seven judges' scores and outputs the overall score for that dive. The program should ensure that all inputs are within the allowable data ranges.
What do you know about natural medicines herbal cures : What do you know about "natural" medicines, herbal cures and folklore or cultural practices to treat ailments? What practices do your family use
Consider the cash flows : Consider the following cash flows: Year Cash Flow 0 –$ 34,000 1 15,100 2 16,600 3 12,500 Howell Petroleum, Inc., is trying to evaluate a generation project with the following cash flows: Year Cash Flow 0 –$37,500,000 1 56,500,000 2 –12,500,000
Estimates the cash flows used to analyze a proposed project : Which of the following should be considered when a company estimates the cash flows used to analyze a proposed project?
How do one uses the macauleys model : How do one uses the Macauleys model to find deflections of bars

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd