Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You have been hired by the organisers of a chess tournament. The tournament has competitors engaging in matches throughout the world. Every single player plays

You have been hired by the organisers of a chess tournament. The tournament has competitors engaging in matches throughout the world. Every single player plays against every other player. Players are awarded points in the following manner: 3 points for winning, 1 point for a tie, no points for losing. The scores for all players have now been collected. You have been tasked with finding the score of the bronze medallist(s). You are to write a program that reads from standard input a series of space-separated non-negative integers no greater than 10,000. Your program is to then write, to standard output, the integer value corresponding to the score of the bronze medallist. Note, that multiple contestants can tie with the same score, however, there will only be one gold, silver, and bronze medallist. In the case of ties, the competitor with lowest accumulated time to take their turn wins. Your program need only report the score of the bronze medallist.

The program should read from standard integers, each integer being between zero (0) and ten thousand (10,000), and then writes to standard out a single integer representing the score of the bronze medalist

You are NOT to use any Java Standard Library Containers (e.g. List), nor the class java.util.Arrays nor any associated methods (e.g. Sort()). You may use standard Java arrays. For example the following code is valid: int myArray[] = new int[5]; You may also use the Standard Library for reading the input (e.g. Scanner, nextInt()) and for output.

When trying to run the program it should run like this :

javac Program.java

echo 27 3 9 3 6 27 10 15 8 | java Program

15

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

Recommended Textbook for

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

Describe discrimination and harassment in the workplace.

Answered: 1 week ago