Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the code in java eclipse Complete all the tasks to show the output shown below Start writing code this way The output should show
Write the code in java eclipse
Complete all the tasks to show the output shown below
Start writing code this way
The output should show results like this
Task Name Parameters Description Return Type double 1 convertToDouble String v Converts v to a double value 2 convertToInteger integer String v String vl. String v2 double 3 getAverage String String player 4 winPercentage String String player Converts v to a integer value Calculates the average of two numbers that are represented as Strings Calculates the win percentage (wins / (wins + losses + ties) of the specified player from the Player_Phasel or Player_Phase2 arrays and returns the value as a String representation of the value formatted to two decimal places. Calculates the loss percentage (loss/ (wins + losses) of the specified player from the Player_Phasel or Player_Phase2 arrays and returns the value as a String representation of the value formatted to two decimal places. Calculates the tie-loss percentage (ties / losses) of the specified player from the Player_Phasel or Player_Phase2 arrays and returns the value as a String representation of the value formatted to two decimal places. Displays the output shown on slide 6 5 lostPercentage String String player 6 tieLossPercentage 7 displayAllPlayerStatistics void None public static String[][] Players_Phase1 = { {"Alpha-1","100","48","2","10"}, {"Beta-1","60","87","3", "8"}, {"Gamma-1","70","76","4","6"}, {"Tau-1","30","100","20","10"}, {"AI-1","145","4","1","12"}}; { public static String[][] Players_Phase2 {"Alpha-2","42","50","5","10"}, {"Beta-2","39","51","7","9"}, {"Gamma-2","48","40","9","5"}, {"Tau-2","26","61","10","10"}, {"AI-2","96","1","0","1"}}; public static void main(String[] args) { displayAllplayerStatistics(); } } ALL PLAYER STATISTICS Losses Ties Win% Player Wins Loss% TieLoss% Current Level PHASE I 40 Alpha-1 Beta-1 Gamma-1 Tau-1 AI-1 100 60 70 30 145 48 2 66.67 87 3 76 4 46.67 100 20 20 4 1 96.67 Aggregated Wins: 405 33.33 4.17 60 3.45 53.33 5.26 80 20 3.33 25 Aggregated Losses: 315 10 8 6 10 12 Aggregated Ties: 30 10 9 Alpha-2 Beta-2 Gamma-2 Tau-2 AI-2 PHASE II 42 39 48 26 96 50 5 43.3 51 7 40.21 40 9 49.48 61 10 26.8 1 98.97 Aggregated Wins: 251 56.7 10 59.79 13.73 50.52 22.5 73.2 16.39 1.03 0 Aggregated Losses: 203 5 10 1 Aggregated Ties: 31Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started