Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the code for following in Java Question 1: Rank the IMO Participants International Mathematical Olympiad (IMO) is held each year since 1959. It is

Write the code for following in Java

image text in transcribed

Question 1: Rank the IMO Participants International Mathematical Olympiad (IMO) is held each year since 1959. It is the oldest of the kind. Each team contains 6 members. The rank of a team is decided by the sum of the scores of all its 6 members. The rank of a participants is decided by his/her individual scores among all the participants. You are asked to develop a program to rank the teams and the participants. Some more detailed requirements: The score of a participant is an integer and in the range of [0, 50). 2D array is used to store a predefined data set. Ranking an array is different from sorting an array. Assume an array is (3, 4, 2), the ranks of the elements in ascent order are (2,3,1). If two elements are the same, they are ranked the same. The next rank after the duplicate elements should be added by 1. Assume an array is (3, 3, 4, 2}, the ranks are {2, 2, 4, 1}. Intensively use array and loop. No need to use any sorting algorithm. Print the results. You do not need to sort the results. Sample Testing Case: The raw data: P6 6 Team 1 Team 2 Team 3 P1 39 40 42 P2 40 41 40 P3 17 27 26 P4 35 41 42 P5 42 42 42 36 35 The printed results: The ranking list: P1 P2 P3 P4 P5 P6 Team 1 39(11) 40 (8) 17(17) 35(13) 42 (1) 6(18) Team 2 40 (8) 41 (6) 27 (15) 41 (6) 42 (1) 36(12) Team 3 42 (1) 40 (8) 26(16) 42 (1) 42 (1) 35 (13) Total Rank 179 3 227 1 227 1 Question 1: Rank the IMO Participants International Mathematical Olympiad (IMO) is held each year since 1959. It is the oldest of the kind. Each team contains 6 members. The rank of a team is decided by the sum of the scores of all its 6 members. The rank of a participants is decided by his/her individual scores among all the participants. You are asked to develop a program to rank the teams and the participants. Some more detailed requirements: The score of a participant is an integer and in the range of [0, 50). 2D array is used to store a predefined data set. Ranking an array is different from sorting an array. Assume an array is (3, 4, 2), the ranks of the elements in ascent order are (2,3,1). If two elements are the same, they are ranked the same. The next rank after the duplicate elements should be added by 1. Assume an array is (3, 3, 4, 2}, the ranks are {2, 2, 4, 1}. Intensively use array and loop. No need to use any sorting algorithm. Print the results. You do not need to sort the results. Sample Testing Case: The raw data: P6 6 Team 1 Team 2 Team 3 P1 39 40 42 P2 40 41 40 P3 17 27 26 P4 35 41 42 P5 42 42 42 36 35 The printed results: The ranking list: P1 P2 P3 P4 P5 P6 Team 1 39(11) 40 (8) 17(17) 35(13) 42 (1) 6(18) Team 2 40 (8) 41 (6) 27 (15) 41 (6) 42 (1) 36(12) Team 3 42 (1) 40 (8) 26(16) 42 (1) 42 (1) 35 (13) Total Rank 179 3 227 1 227 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Describe the menstrual cycle in a woman.

Answered: 1 week ago

Question

Explain methods of metal extraction with examples.

Answered: 1 week ago

Question

1. What are your creative strengths?

Answered: 1 week ago

Question

What metaphors might describe how we work together?

Answered: 1 week ago