Question: can you help to write a code, the main objective is to find the top 2 average, and my class is working with java import
can you help to write a code, the main objective is to find the top 2 average, and my class is working with java
import java.util.ArrayList; import java.util.Random; class Main public static void main(String[] args) f System.out.println("avg of top two") ArrayList Integer> scores new ArrayList Integer>O Random randnew Random (29); scores.add (rand.nextInt (100)) System.out.println(scores "navgTopTwoaverageTopTwo (scores)); //returns the average of the two largest elements in list public static double averageTopTwo (ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
