Task: (5 marks) Last year, the Chinese people were crazy of Tokyo Olympic diving competition because...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Task: (5 marks) Last year, the Chinese people were crazy of Tokyo Olympic diving competition because of a 14-year-old young girl who scored a few fantastic perfect 10's diving. A lot of us may wonder how they come up with the scores for the diving competition. It takes several steps to get from the judge ratings to the final scores, and the announcers are rarely eager to explain it. 1 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) Cross out the outliers: So cross out two scores on each end: 6.5, 7.0, 7.0, 7.5, 7.5, 8.0, 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 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.0 x 2.8 = 61.6. In the competition, divers need to dive a few rounds, normally 5 rounds in final. Let us look at the UML diagram for this assignment: -String name -String player -int age Country +Country(String name, String player, int age) +String getName( +String getPlayer( +int getAge( +void setinfo(String name, String player, int age) Q-final String Countries Three classes: MainA3 -static void getScore(double score) -static String getCountry(ArrayList<Diving> alist, double result) -static void displaySorted List(ArrayList<Diving alist) -static double getDifficulty -static int getAge( -static void displayGameInfo(ArrayList<Diving > alist) -static void displayResultInfo(ArrayList<Diving > alist) -static void updateCFArray(ArrayList Diving> alist, double cfArray) + static void main(String args) static int SIZE -Country name -double score -double difficulty -double cf 4-double fs Diving +Diving (Country name, double score, double difficulty, double cf) +Country getCountry +double getDifficulty +double getCarriedForward( +double getFinalScore( +void setDifficulty(double difficulty) -ArrayList Double>getSortedList() -double highest() -double secondHighest() -double lowest -double secondLowest) double finalScore( double getTotalScore( +void printinfo() A class to describe a Country: name of the country, name of the player and the player's age. A class to describe a Diving: A constant SIZE (no of judges), a Country object, the scores given by all judges, the degree of difficulty, the carried forward scores (cf) and the final scores (fs). Most of 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 In main class, you define an array of countries to be used in the design. The countries can be duplicated. Let us look at the runtime analysis: Round: 1 Starting position Country China 2 Thailand China 1 South South Korea Japan LISA USA Australia Malaysia Russia Brazil Countries China 2 Thailand China 1 South Korea Dapan USA Australia Malaysia Russia Brazil The result is 1 Australia 2 Thailand Diver 2 Name 1 Name 2 Name Name 3 Home Name 4 Nome Name 5 Name Name 6 A 6 Name 7 Malaysia 10 Russia Name 8 Name 9 Name 10 USA Janar Japan China 1 Brazil China 2 South Korea Age 79.20 72.00 62.10 61.20 57.20 56.40 39.00 35.70 27.60 27.50 ទី១៩ ៩ខ ១ ឆ ជ ដ ង ៦ន 22 22 20 16 16 17 17 21 21 24 15 17 17 Difficulty 8.0 8.0 2.6 4.0 4.4 2.1 24 3.4 31 32 J3 34 35 2.0 7.0 0.5 9.5 4.0 4.0 4.0 10.0 2.0 5.5 5.5 7.0 6.0 3.0 2.0 1.0 4.0 8.0 0.0 7.0 3.0 7.0 2.8 2.0 8.0 7.5 5.5 5.5 5.5 1.5 5.5 7.8 9.0 9.0 7.0 1.5 1.0 1.5 6.8 0.5 6.0 6.8 6.0 0.5 10.0 8.5 4.5 0.0 0.5 1.0 4.5 1.0 3.0 7.5 5.5 0.5 0.0 6.5 5.0 8.5 6.0 1.0 4.6 18 4.8 4.6 2.5 4.7 36 37 Difficulty 9.5 8.0 7.0 7.5 10.0 6.0 2.0 6.0 3.0 3.0 9.5 2.6 4.0 4.4 2.1 3.4 3.4 4.6 4.8 4.6 2.5 4.7 Let us now look at the information of Round 2: c/f Current 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 39.00 72.00 57.20 35.70 61.28 61.20 62.10 79.20 27.60 27.50 56.40 Total 39.00 72.00 57.20 35.70 61.28 61.20 62.18 62.10 79.20 27.60 27.50 56.40 In Round 1, the panel divers' information, the country, the name of the diver, his / her age, and the level of difficulty. The scores for each diver, the carried forward's score (for round 1, no carried forward score), the current score (i.e., the final score) and the total score. The total score will then be the carried forward score for the next round. After each round, you need to sort the total scores and display the ranking after each round. Round: 2 starting position Country China 2 Thailand China 1 South Korea Japan USA Australia Malaysia Russia Brazil Countries China 2 Thailand China 1 South Korea Japan USA Australia Malaysia Russia Brazil The result is 1 China 1 2 Australia 3 Japan USA Russia Thailand 9 Brazil Diver Name 1 Name 2 e Malaysia Name 3 Name 4 Name 5 Name 6 Name 7 Name 8 South Korea China 2 Name 9 Name 10 17 Age 22 22 20 16 17 21 24 15 17 31 32 33 34 35 36 37 Difficulty 6.0 6.5 0.5 2.5 5.5 5.5 9.0 8.5 3.0 3.5 5.5 0.5 9.5 5.0 6.0 0.0 1.0 9.0 1.5 5.5 5.5 2.5 8.0 6.5 6.5 9.5 7.5 8.5 10.0 5.5 3.5 3.5 0.5 4.0 7.0 0.0 9.0 10.0 2.0 0.0 0.0 1.0 1.5 8.0 6.5 10.0 7.0 1.5 5.0 2.5 1.5 5.0 2.0 0.5 10.0 7.5 9.5 5.5 4.5 3.5 6.5 7.5 2.0 0.5 5.0 10.0 0.0 4.5 9.0 134.00 117.20 116.70 113.70 108.35 96.00 94.20 91.70 88.30 69.40 Difficulty 3.1 2.0 4.8 4.5 3.0 4.3 2.0 4.4 4.9 2.2 Let me show you one more round; round 3: c/f Current 52.70 24.00 76.80 3.1 2.0 4.8 57.20 4.5 35.70 3.0 61.20 4.3 62.10 2.0 79.20 27.60 39.00 72.00 4.4 4.9 27.50 2.2 56.40 Total 91.70 96.00 134.00 94.20 58.50 55.50 116.70 51.60 113.70 38.00 117.20 41.80 69.40 80.85 108.35 31.90 88.30 Round: 3 Starting position Country China 2 Thailand China 1 South Korea Japan USA Australia Malaysia Russia Brazil Countries China 2 Thailand China 1 South Korea Dapan USA USA Australia Malaysia Russia Brazil The result is Thailand Australia China 1 USA chi China 2 Russia Brazil 10 Malaysia Diver Name 1 Name 2 Name 3 Name 4 - Name 5 vame Name 6 Name 7 Name 8 Name 9 Name 10 31 9.5 8.0 4.0 6.0 Japan South Korea 6.6 5.5 5.5 Age 22 NAGANNAD 22 20 16 17 21 24 15 37 0.0 0.0 4.5 4.5 9.5 4.0 4.0 2.5 2.5 6.5 9.0 3.5 0.0 7.0 3.5 7.5 6.0 8.5 0.0 2.0 0.0 2.5 3.0 10.0 0.0 4.5 1.0 0.0 3.0 0.0 5.5 4.5 8.0 9.0 4.0 3.0 1.5 6.0 4.0 5.0 9.0 17 17 32 33 5.5 6.5 9.0 9.5 1.0 4.5 1.0 4.5 1.5 1.5 4.5 7.0 0.5 0.5 178.80 164.80 162.00 157.45 154.40 Difficulty 3.8 4.6 2.0 3.9 3.7 2.5 2.8 2.1 2.1 2.5 146.30 144.90 127.25 125.80 83.05 34 35 0.0 10.0 2.5 7.0 6.5 5.0 6.5 2.0 2.0 5.5 1.5 1.5 5.5 8.5 36 4.5 3.0 9.5 2.5 2.5 Note that you need to display up to 5 rounds. A few important tasks to be done in the main class: Difficulty 3.8 4.6 2.0 3.9 3.7 3.1 2.5 2.8 2.1 2.1 2.5 c/f 91.70 96.00 134.00 134.68 94.20 116.70 113.70 117.20 69.40 Current 62.70 82.80 28.00 50.70 144.90 58.70 29.60 Total 154.40 178.80 162.00 146.30 157.45 164.80 13.65 83.05 108.35 18.90 127.25 88.30 37.50 125.80 43.75 47.60 To construct a list of Country objects Some methods to generate for example the degree of difficulty (between 2 to 5), the age (between 15 to 30) A method to display the game info (display game info method) A method to display the result (display result method together with print info method defined in the Diving class) A method to display the ranking (display sorted list method) There is a getCountry method, I use this method to get the name of the country that has "certain" result. This is an optional method, you can find your own way to solve your problem. Convenient to your design, feel free to amend the suggested methods. Task: (5 marks) Last year, the Chinese people were crazy of Tokyo Olympic diving competition because of a 14-year-old young girl who scored a few fantastic perfect 10's diving. A lot of us may wonder how they come up with the scores for the diving competition. It takes several steps to get from the judge ratings to the final scores, and the announcers are rarely eager to explain it. 1 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) Cross out the outliers: So cross out two scores on each end: 6.5, 7.0, 7.0, 7.5, 7.5, 8.0, 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 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.0 x 2.8 = 61.6. In the competition, divers need to dive a few rounds, normally 5 rounds in final. Let us look at the UML diagram for this assignment: -String name -String player -int age Country +Country(String name, String player, int age) +String getName( +String getPlayer( +int getAge( +void setinfo(String name, String player, int age) Q-final String Countries Three classes: MainA3 -static void getScore(double score) -static String getCountry(ArrayList<Diving> alist, double result) -static void displaySorted List(ArrayList<Diving alist) -static double getDifficulty -static int getAge( -static void displayGameInfo(ArrayList<Diving > alist) -static void displayResultInfo(ArrayList<Diving > alist) -static void updateCFArray(ArrayList Diving> alist, double cfArray) + static void main(String args) static int SIZE -Country name -double score -double difficulty -double cf 4-double fs Diving +Diving (Country name, double score, double difficulty, double cf) +Country getCountry +double getDifficulty +double getCarriedForward( +double getFinalScore( +void setDifficulty(double difficulty) -ArrayList Double>getSortedList() -double highest() -double secondHighest() -double lowest -double secondLowest) double finalScore( double getTotalScore( +void printinfo() A class to describe a Country: name of the country, name of the player and the player's age. A class to describe a Diving: A constant SIZE (no of judges), a Country object, the scores given by all judges, the degree of difficulty, the carried forward scores (cf) and the final scores (fs). Most of 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 In main class, you define an array of countries to be used in the design. The countries can be duplicated. Let us look at the runtime analysis: Round: 1 Starting position Country China 2 Thailand China 1 South South Korea Japan LISA USA Australia Malaysia Russia Brazil Countries China 2 Thailand China 1 South Korea Dapan USA Australia Malaysia Russia Brazil The result is 1 Australia 2 Thailand Diver 2 Name 1 Name 2 Name Name 3 Home Name 4 Nome Name 5 Name Name 6 A 6 Name 7 Malaysia 10 Russia Name 8 Name 9 Name 10 USA Janar Japan China 1 Brazil China 2 South Korea Age 79.20 72.00 62.10 61.20 57.20 56.40 39.00 35.70 27.60 27.50 ទី១៩ ៩ខ ១ ឆ ជ ដ ង ៦ន 22 22 20 16 16 17 17 21 21 24 15 17 17 Difficulty 8.0 8.0 2.6 4.0 4.4 2.1 24 3.4 31 32 J3 34 35 2.0 7.0 0.5 9.5 4.0 4.0 4.0 10.0 2.0 5.5 5.5 7.0 6.0 3.0 2.0 1.0 4.0 8.0 0.0 7.0 3.0 7.0 2.8 2.0 8.0 7.5 5.5 5.5 5.5 1.5 5.5 7.8 9.0 9.0 7.0 1.5 1.0 1.5 6.8 0.5 6.0 6.8 6.0 0.5 10.0 8.5 4.5 0.0 0.5 1.0 4.5 1.0 3.0 7.5 5.5 0.5 0.0 6.5 5.0 8.5 6.0 1.0 4.6 18 4.8 4.6 2.5 4.7 36 37 Difficulty 9.5 8.0 7.0 7.5 10.0 6.0 2.0 6.0 3.0 3.0 9.5 2.6 4.0 4.4 2.1 3.4 3.4 4.6 4.8 4.6 2.5 4.7 Let us now look at the information of Round 2: c/f Current 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 39.00 72.00 57.20 35.70 61.28 61.20 62.10 79.20 27.60 27.50 56.40 Total 39.00 72.00 57.20 35.70 61.28 61.20 62.18 62.10 79.20 27.60 27.50 56.40 In Round 1, the panel divers' information, the country, the name of the diver, his / her age, and the level of difficulty. The scores for each diver, the carried forward's score (for round 1, no carried forward score), the current score (i.e., the final score) and the total score. The total score will then be the carried forward score for the next round. After each round, you need to sort the total scores and display the ranking after each round. Round: 2 starting position Country China 2 Thailand China 1 South Korea Japan USA Australia Malaysia Russia Brazil Countries China 2 Thailand China 1 South Korea Japan USA Australia Malaysia Russia Brazil The result is 1 China 1 2 Australia 3 Japan USA Russia Thailand 9 Brazil Diver Name 1 Name 2 e Malaysia Name 3 Name 4 Name 5 Name 6 Name 7 Name 8 South Korea China 2 Name 9 Name 10 17 Age 22 22 20 16 17 21 24 15 17 31 32 33 34 35 36 37 Difficulty 6.0 6.5 0.5 2.5 5.5 5.5 9.0 8.5 3.0 3.5 5.5 0.5 9.5 5.0 6.0 0.0 1.0 9.0 1.5 5.5 5.5 2.5 8.0 6.5 6.5 9.5 7.5 8.5 10.0 5.5 3.5 3.5 0.5 4.0 7.0 0.0 9.0 10.0 2.0 0.0 0.0 1.0 1.5 8.0 6.5 10.0 7.0 1.5 5.0 2.5 1.5 5.0 2.0 0.5 10.0 7.5 9.5 5.5 4.5 3.5 6.5 7.5 2.0 0.5 5.0 10.0 0.0 4.5 9.0 134.00 117.20 116.70 113.70 108.35 96.00 94.20 91.70 88.30 69.40 Difficulty 3.1 2.0 4.8 4.5 3.0 4.3 2.0 4.4 4.9 2.2 Let me show you one more round; round 3: c/f Current 52.70 24.00 76.80 3.1 2.0 4.8 57.20 4.5 35.70 3.0 61.20 4.3 62.10 2.0 79.20 27.60 39.00 72.00 4.4 4.9 27.50 2.2 56.40 Total 91.70 96.00 134.00 94.20 58.50 55.50 116.70 51.60 113.70 38.00 117.20 41.80 69.40 80.85 108.35 31.90 88.30 Round: 3 Starting position Country China 2 Thailand China 1 South Korea Japan USA Australia Malaysia Russia Brazil Countries China 2 Thailand China 1 South Korea Dapan USA USA Australia Malaysia Russia Brazil The result is Thailand Australia China 1 USA chi China 2 Russia Brazil 10 Malaysia Diver Name 1 Name 2 Name 3 Name 4 - Name 5 vame Name 6 Name 7 Name 8 Name 9 Name 10 31 9.5 8.0 4.0 6.0 Japan South Korea 6.6 5.5 5.5 Age 22 NAGANNAD 22 20 16 17 21 24 15 37 0.0 0.0 4.5 4.5 9.5 4.0 4.0 2.5 2.5 6.5 9.0 3.5 0.0 7.0 3.5 7.5 6.0 8.5 0.0 2.0 0.0 2.5 3.0 10.0 0.0 4.5 1.0 0.0 3.0 0.0 5.5 4.5 8.0 9.0 4.0 3.0 1.5 6.0 4.0 5.0 9.0 17 17 32 33 5.5 6.5 9.0 9.5 1.0 4.5 1.0 4.5 1.5 1.5 4.5 7.0 0.5 0.5 178.80 164.80 162.00 157.45 154.40 Difficulty 3.8 4.6 2.0 3.9 3.7 2.5 2.8 2.1 2.1 2.5 146.30 144.90 127.25 125.80 83.05 34 35 0.0 10.0 2.5 7.0 6.5 5.0 6.5 2.0 2.0 5.5 1.5 1.5 5.5 8.5 36 4.5 3.0 9.5 2.5 2.5 Note that you need to display up to 5 rounds. A few important tasks to be done in the main class: Difficulty 3.8 4.6 2.0 3.9 3.7 3.1 2.5 2.8 2.1 2.1 2.5 c/f 91.70 96.00 134.00 134.68 94.20 116.70 113.70 117.20 69.40 Current 62.70 82.80 28.00 50.70 144.90 58.70 29.60 Total 154.40 178.80 162.00 146.30 157.45 164.80 13.65 83.05 108.35 18.90 127.25 88.30 37.50 125.80 43.75 47.60 To construct a list of Country objects Some methods to generate for example the degree of difficulty (between 2 to 5), the age (between 15 to 30) A method to display the game info (display game info method) A method to display the result (display result method together with print info method defined in the Diving class) A method to display the ranking (display sorted list method) There is a getCountry method, I use this method to get the name of the country that has "certain" result. This is an optional method, you can find your own way to solve your problem. Convenient to your design, feel free to amend the suggested methods.
Expert Answer:
Answer rating: 100% (QA)
ANSWER import javautil class defintion for Country class Country instance fields private String name ... View the full answer
Related Book For
Management A Practical Introduction
ISBN: 978-0078112713
5th edition
Authors: Angelo Kinicki, Brian Williams
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Kellogg Company is expected to pay $2.00 in annual dividends to its common shareholders in the future. Our best estimate of the expected cost of equity capital is 5.0% and the expected growth rate in...
-
What are the two major types of constraints on decisions that involve ethical issues? Provide examples of each type.
-
The following information is available for Skysong Corporation's available-for-sale debt securities at December 31, 2020. Security Cost Fair Value X $31,280 $27,600 Y 22,080 29,440 $53,360 $57,040...
-
Serum cholesterol levels (y) and age in years (x) were recorded for several men in a medical center. Cholesterol levels were measured in milligrams per deciliter. The following MINITAB output...
-
Profit Corporation authorized Anderson, an employee, to find a buyer for used equipment that Profit intended to sell. Anderson believed that he had authority to contract for the sale of the...
-
Which of the individuals made the best use of their credit card? Which made it worse? Why? What should you look for when choosing a credit card? What is a "grace period"? How can it help you manage a...
-
On July 1, 2015, Andrea Robson established an interior decorating business, Finishing Designs. During the month, Andrea completed the following transactions: July 1. Andrea transferred cash from a...
-
The temperature underground, below some depth (depending on soil composition) is approximately constant throughout the year. A ground source (i.e., geothermal) heat pump takes advantage of this...
-
GOOD FELLAS CATERING Truck Depreciation Schedule Straight-Line Method Cost of Asset: $56,500 Salvage Value: $5,500 Length of Service (yrs): 5 Depreciable Base: Annual Depreciation: Straight-Line...
-
Below are 3 reference sample questions with solution answers and the work provided for reference on how to do Problem 1 above. TechSave Inc. is a technology company with four software development...
-
Is correct. Calculate the predetermined overhead rate for 2022, assuming Sandhill Manuf costs of $1,570,000, direct labour costs of $752,000, and direct labour hours of places, e.g. 21.11.)
-
CAREM INDUSTRIES (courtesy of and adapted from Anoop Rai, Copyright 2007) Michelle Raymar, VP of Finance at Carem Industries, was about to head to a meeting with her junior colleagues to discuss...
-
1. What is a good critique for a case study design not suitable for a research topic " Servant leadership and its impact on employee well-being" 2. What are some key arguments for using a...
-
Qualitative data can be graphically represented by using a : Line graph Frequency polygon Bar diagram Ogives
-
Write a while loop that uses an explicit iterator to accomplish the same thing as Exercise 7.3. Exercise 7.3. Write a for-each loop that calls the addInterest method on each BankAccount object in a...
-
I. Do nothing. Ms. Amarsingh's behavior violated corporate policy about the treatment of customers and she deserved to be fired. Changing the decision would set a bad precedent for other employees....
-
What would you do given the current situation? 1. Charge Mr. Hills. He knew that it was against U.S. policy to have dealings with terrorist organizations. 2. Fine the company $25 million. The company...
-
I. To what extent is Providence using evidence-based management? Do you think that this is a good way to run a hospital? Explain your rationale. 2. To what extent are the managerial practices being...
-
Form small groups for this exercise on claim and adjustment letters. Have each member of your group study the following two letters. Meet and discuss your reactions to the two letters. How...
-
You work in the customer relations department of a company that makes plumbing supplies. The head of product development has just handed you the draft of installation instructions for a sliding tub...
-
Study the excerpt from the Micron data flyer (2010, p. 9). Describe the designers use of alignment as a design principle. How effective is it? How would you modify it? Present your analysis and...
Study smarter with the SolutionInn App