Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is runner code: import java.util.Scanner; import java.util.ArrayList; public class runner_U7_L2_Activity_Two{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); ArrayList vals = new

image text in transcribed

This is runner code: import java.util.Scanner; import java.util.ArrayList;

public class runner_U7_L2_Activity_Two{

public static void main(String[] args){ Scanner scan = new Scanner(System.in); ArrayList vals = new ArrayList(); System.out.println("Enter ArrayList length:"); int len = scan.nextInt(); System.out.println("Enter values:"); for(int i = 0; i Instructions Write a public static method named average which takes an ArrayList of Double objects, and returns the average of the values in this list. Write your average method in the U7_L2_Activity Two class. Use the runner class to test your method but do not add a main method to the U7_L2_Activity Two.java file or your code will not be scored correctly. Hint: when your method header, and specify the type of the parameter as an ArrayList , make sure you include the data type your ArrayList will contain in angle brackets (). you write

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_2

Step: 3

blur-text-image_3

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

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions

Question

a. What is the purpose of the team?

Answered: 1 week ago

Question

b. What are its goals and objectives?

Answered: 1 week ago