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 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 list)f double avg 0.0; //YOUR CODE GOES HERE return avg

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!