Question: Can I get 5 testplan examples, and UML Class diagram for my following code java code? import java.util.ArrayList; import java.util.Scanner; class Height { private final
Can I get testplan examples, and UML Class diagram for my following code java code? import java.util.ArrayList;
import java.util.Scanner;
class Height
private final int feet;
private final int inches;
public Heightint feet, int inches
this.feet feet;
this.inches inches;
public int toInches
return feet inches;
@Override
public String toString
int normalizedInches inches ;
return feet normalizedInches ;
class Player
private final String name;
private final Height height;
private final int age;
public PlayerString name, Height height, int age
this.name name;
this.height height;
this.age age;
public String getName
return name;
public Height getHeight
return height;
public int getAge
return age;
@Override
public String toString
return "Name: name Height: height.toString Age: age;
public class Project
public static void mainString args
Scanner scanner new ScannerSystemin;
ArrayList players new ArrayList;
int totalAge ;
System.out.printEnter the number of players: ;
int numPlayers scanner.nextInt;
scanner.nextLine; Consume the newline
for int i ; i numPlayers; i
System.out.printEnter player's name: ;
String name scanner.nextLine;
System.out.printEnter player's height feet inches: ;
int feet scanner.nextInt;
int inches scanner.nextInt;
Height height new Heightfeet inches;
scanner.nextLine; Consume the newline
System.out.printEnter player's age: ;
int age scanner.nextInt;
scanner.nextLine; Consume the newline
totalAge age;
Player player new Playername height, age;
players.addplayer;
double averageAge double totalAge numPlayers;
System.out.printlnAverage age of all players: averageAge;
Player tallestPlayerBelowAverage null;
int maxHeight ;
for Player player : players
if playergetAge averageAge && player.getHeighttoInches maxHeight
maxHeight player.getHeighttoInches;
tallestPlayerBelowAverage player;
if tallestPlayerBelowAverage null
System.out.printlnTallest player below or equal to average age: tallestPlayerBelowAverage;
else
System.out.printlnNo player found matching the criteria.";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
