Question: I need help on creating this java code, (im struggling at these) creating private static boolean dlnArray (double d, double [] dArray), private static double

![creating private static boolean dlnArray (double d, double [] dArray), private static](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f539a96ac9f_11266f539a8deedd.jpg)
I need help on creating this java code, (im struggling at these) creating private static boolean dlnArray (double d, double [] dArray), private static double [] getDArray () and private static void displayCountryInfo (Country c). ![Country(String name, String player, int age, double] dArray) + String getName0 +](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f539aad5169_11466f539aa4b404.jpg)
![String getPlayer0 +int getAge 0 + double] getDArray0 + void setinfo(String name,](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f539ab99f3f_11566f539ab2685d.jpg)


![double cf - double fs. +Ding(Country name, double] score, double difficulty, double](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f539adf301c_11766f539ad75c25.jpg)
+ Country(String name, String player, int age, double] dArray) + String getName0 + String getPlayer0 +int getAge 0 + double] getDArray0 + void setinfo(String name, String player, int age, doubled dArray) + void displaylnfo0 Diving + static int 812F - Country name - doublef score - double difficulty - double cf - double fs. +Ding(Country name, double] score, double difficulty, double cf) + Country getCountryo + double getDificultyo - double getCarriedForward0 + double getfinalScore0 + void setDifficulty(double dificulty) - ArrayListeDoubles getSortedListo - double highesto - double secondHighesto - double lowesto - double secondLowesto - double finalScore0 - double getTotalScore0 - void displayinfo 0 Each judge rates the dive from 0 ("completely failed") to 10 ("excellent"). This is based on how well the diver performs, from his starting position to entry into the water. The judges do not take difficulty into account for this score. - Example: a diver receives execution scores of 6.5, 7.0, 7.0, 7.5, 7.5, 8.0, and 8.0. Note that the score is either .0 or .5( is from 0 to 10), maximum is 10.0 Cross out the outliers: So cross out two scores on each end: 6.5,7.9,7.0,7.5,7.5, 8.9, and 8.0, i.e., remove the two top and two bottom scores Add the rest together. Find the sum of the remaining scores. -Example: 7.0+7.5+7.5=22.0 Multiply by the degree of difficulty (DD). Each attempted dive has a degree of difficulty calculated in advance. This is based on many factors, such as the number of twists and somersaults and the take-off and entry positions. Multiply your last sum by the degree of difficulty to get the final score for this dive. - Example: Let's say the diver attempted an inward 21/2 somersault dive in the 10 meters competition, in the pike position. This has a difficulty score of 2.8. Multiply this by the execution score to get the final score: 22.0x 2.8=61.6. Note that the degree of difficulty has only one decimal point, i.e., *.\# (* is 1,2,3,4, very seldom 5 , \# is 0 to 9 ). In a competition, divers need to dive a few rounds, normally 5 rounds. The degrees of difficulty, for each round, are usually pre-determined before the beginning of the competition. Let us look at a simple UML diagram for this assignment: Two important classes: Country class, Diving class; and a main class that we will define it later. Convenient to your design, additional class(es) is / are allowed. Let us now look at the detail of each class. Basically each class has private instance variables, constructors, accessor methods, mutator methods and some other methods 2 related to the class(es). Methods are either public or private; instance variables must be private. Let us start with the Country class: It consists of four private instance variables: name (of a country), player (name of a player), age (of the player) and dArray (an array of difficulty). A constructor to initialize the instance variables, some accessor methods, a mutator method and a display info method. Additional methods are allowed. Additional instance variables or any change to instance variables are not allowed. Usually a player participates in a diving competition, he / she needs to declare the level of diving difficulties before the competition. The competition usually consists of 5 rounds. This array stores 5 real number representing the degree of difficulties of each round. The display Info method displays the info of a participant, for example, Thailand Name 2 152.12.52.64.44.5 Note that this array (dArray) is "pre" sorted before comstructing a Count ry object. Next, let us look at the Diving class which is the most important class of this assignment: This class has a constant SIZE indicating the number of judges, usually is 7 . It consists of 5 instance variables: name (a Country object), score (an array, scores given by judges), difficulty (level of difficuly of each dive), cf (carried forward derived from the previous round, obviously round 1 has no carried forward score, i.e. 0 and is (the final score of the current round). Most of the methods are obvious in definition. The getSortedList stores the stores the scores in a list (a dummy list) and sort it; you can use it to retrieve the highest, second highest etc. scores. This method is optional, you can find your own way to solve the problem. The display info method displays the result of a participant according to the following format: (you will see order of printing during the runtime interactions and displays): Thailand 0.5 8.3.50.59.0.58. 2.1 8.00 25.20 25.20 Now our main class to drive the whole application. Let us look at the UML diagram: We define a constant to store the number of rounds for a competition. I may ask you to change the value of this constant during demo; just make sure that you produce a general design. We define a string array of countries (Countries) to be used in the design. A country can send more than one participant. We usually use, for example, China 1, China 2 if China sends two participants. A few important tasks to be done in the main class. Let us look at the runtime interactions and display before we look the methods used in the main class: Upon execution, the system firstly displays the information of each participant: Now, the display of round 1 : Followed by the ranking of round 1 : Some notes to round 1 (and hence for each round), the level of difficulties is extracted from the array of difficulties (i.e., dArray) and the result of each round is sorted. I will show you my way of sorting even we did not cover any sorting topics in lessons 3 . Also note that the carried forward score for each participant is 0.00 as we are in round 1 ; and round 2 onward will copy the total scores obtained from the previous round to the carried forward score; and we will use an array to store the carried forward scores for all the participants. Now look at the interactions and display of round 2 : The ranking for round 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
