Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started