Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given this code Code these Methods 29 30 10 import java.util.Scanner;0 5 60 /* 7 1 8 Working with arrays 9 U2A1 = Player Info

Given this code

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Code these Methods

image text in transcribed

29 30 10 import java.util.Scanner;0 5 60 /* 7 1 8 Working with arrays 9 U2A1 = Player Info 10 */ 11 12 public class U241 { 13 140 public static void main(String[] args) { 15 16 String[] name = new String[5]; //Initializing the Name array for storing names 17 int[] score = new int[5]; //Initializing the score array for storing scores 18 ArrayList plays = new ArrayList(); //Initializing the ArrayList for Big Plays 19 20 Scanner sc = new Scanner(System.in); 21 System.out.println("Enter names of 5 players"); 22 /*Storing the 5 names*/ 23 for(int i = 0; i max) //if value of val[i] is greater than max then store in our max variable max = val[i]; } return max; } /*getMaxValue(ArrayList val) for finding maximum value of Big Plays */ public int getMaxValue(ArrayList val) { 90 System.out.println("Least Big Plays : "+minPlays); 91 92 93 }//End main 94 95 /*getMaxValue(int valll) for finding maximum value of scores */ 960 public int getMaxValue(int val[]){ 97 int max = val[0]; 1/ storing first value into max variable 98 for(int i = 0; i max) //if value of val[i] is greater than max then store in our max variable 101 max = val[i]; 102 } 103 return max; 104 } 105 106 107 /*getMaxValue(ArrayList yal) for finding maximum value of Big Plays */ 1080 public int getMaxValue(ArrayList val) 109 { 110 int max = val.get(); // storing first value into max variable 111 for(int i = 0; i max) //if value of val.get(i) is greater than max then store in our max variable 114 max = val.get(i); 115 116 return max; 117 } 118 1190 public int getMinValue(int val[]){ 120 int max = val[0]; 1/ storing first value into max variable 121 for(int i = 0; i val) 130 { 131 int max = val.get(); // storing first value into max variable 132 for(int i = 0; i sortValues(ArrayList vals) returns a NEW ArrayList with Sorting the wins from Lowest to Highest. To do this you will create a new int [] array, copy the values into sortedVals[] and using nested FOR Loops. (Do NOT use Arrays.sort(). Use nested Loops) double average(int val[]) returns the average. Used for Average Score double averagel ArrayList vals ) returns the average. Used for Average Big Plays ArrayList vals totalPoints(int scores[], ArrayList big Plays ) returns the Total Points. Each Score is worth 1 point each Big Play is worth 2 points. String longestName(String names[]). Return the longest name

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

Step: 3

blur-text-image

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

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

3. Who would the members be?

Answered: 1 week ago