Question: Write a Main class (client class) that creates an array of the following Participant class objects and displays them. public class Participant { private
Write a Main class (client class) that creates an array of the following "Participant" class objects and displays them.
public class Participant { private String name; private double height; private double weight; // Constructs a participant with the given state. public Participant(String name, int height, int weight) { this.name = name; this.height = height; this.weight = weight; } // Returns the participant's body mass index (BMI). public double getBMI() { return weight / (height * height) * 703; } // Returns the participant's height. public double getHeight() { return height; } public void setHeight(int height) { this.height = height; } // Returns the participant's name. public String getName() { return name; } // Returns the participant's weight. public double getWeight() { return weight; } public String toString(){ return "The name of the participant is " + this.name + "."+ " The weight of the participant is " + this.weight +"." + " The height of the participant is " + this.height + "." + " " ; } } Submission Guide: Upload all Java files and a screenshot.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
