Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the scoring Program of judges in java

Shulou Source: shulou.com Published: 2022-06-01 02:56:41 09月29日 Update

This article is to share with you about how java implements the judges' scoring process. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The judges scored

Topic: in the competition, six judges grade the contestants, with an integer score of 0-100. The final score of the contestant is the average score of the four judges excluding the highest score and the lowest score (regardless of the decimal part).

Analysis:

Define an array and initialize the array elements with dynamic initialization, with a length of 6

Enter the judges' scores on the keyboard

Accept the judges' scores by means of cyclic improvement

Define the method implementation to get the highest score in the array (calling method)

Define the method implementation to get the lowest score in the array (call method)

Define the method to implement the sum of the occasional elements in the array (calling method)

Calculate the average score according to the calculation rules

Average output score.

Practice:

Define the method implementation to get the highest score in the array (finally, call the method)

Public static int getMax (int [] arr) {int x=arr [0]; for (int aura)

Tags: Method array judges score element average lowest highest highest score program content dynamic score more articles rules player keyboard length loop Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL MariaDB macOS Linux Microsoft