Help needed!
Design: The ConicalFrustum class has fields, a constructor, and methods as outlined below (1) Fields (instance variables): label of type String, radiusl of type double, radius2 of type double, and height of type double. Initialize the String to and the double variables to 0 in their respective declarations. These instance variables should be private so that they are not directly accessible from outside of the ConicalFrustum class, and these (2) Constructor: Your ConicalFrustum class must contain a public constructor that accepts four parameters (see types of above) representing the label, radius, radius2, and height. Instead of assigning the parameters directly to the fields, the respective set method for each field (described below) should be called since they are checking the validity of the parameter. For example, instead of using the statement label labelIn: use the statement setLabel (labelIn) Below are examples of how the constructor could be used to create Conical Frustum objects. Note that although String and numeric literals are used for the actual parameters (or arguments) in these examples, variables of the required type could have been used instead of the literals -Small, 0.5し0.75し0.25)i ConicalFrustum example2 = new conica!Frustum (Medium, 5.1, 10.2, 15.9); ConicalFrustum example3-new ConicalFrustum(Large, 98.32, 199.0, 250.0) (3) Methods: Usually a class provides methods to access and modify each of its instance variables (known as get and set methods) along with any other required methods. The methods for ConicalFrustum, which should each be public, are described below. See the formulas in the figure above and the Code and Test section below for information on constructing these methods. o getLabel: Accepts no parameters and returns a String representing the label field. o setLabel: Takes a String parameter and returns a boolean. If the String parameter is not null, then the trimmed String is set to the label field and the method returns true. Otherwise, the method returns false and the label is not set o getRadiusl: Accepts no parameters and returms a double representing the radiusl o setRadiusl: Takes a double parameter and returns a boolean. If the double field parameter is non-negative, then the parameter is set to the radius1 field and the method returns true. Otherwise, the method returns false and the radiusl field is not set. o getRadius2: Accepts no parameters and returns a double representing the radius2 field. setRadius2: Takes a double parameter and returns a boolean. If the double parameter is non-negative, then the parameter is set to the radius2 field and the method returns true. Otherwise, the method returns falseand the radius2 field is not set. o o getHeight: Accepts no parameters and returns a double representing the height fieldmedia%2Fed8%2Fed827dda-4d83-49fb-8a1f-97media%2Fe0e%2Fe0e41394-7098-4d8d-90f8-b7media%2Fbda%2Fbda93271-8e0d-4f38-be33-a9media%2Ff4d%2Ff4d13ca2-1373-4cf7-a69e-e1media%2F35d%2F35df3ccb-b1f5-482c-88e6-c5media%2Fc66%2Fc662474b-3848-4db8-8d70-38
media%2F29d%2F29dcd3c6-b20d-4091-8f84-a7Design: The ConicalFrustum class has fields, a constructor, and methods as outlined below (1) Fields (instance variables): label of type String, radiusl of type double, radius2 of type double, and height of type double. Initialize the String to “and the double variables to 0 in their respective declarations. These instance variables should be private so that they are not directly accessible from outside of the ConicalFrustum class, and these (2) Constructor: Your ConicalFrustum class must contain a public constructor that accepts four parameters (see types of above) representing the label, radius, radius2, and height. Instead of assigning the parameters directly to the fields, the respective set method for each field (described below) should be called since they are checking the validity of the parameter. For example, instead of using the statement label labelIn: use the statement setLabel (labelIn) Below are examples of how the constructor could be used to create Conical Frustum objects. Note that although String and numeric literals are used for the actual parameters (or arguments) in these examples, variables of the required type could have been used instead of the literals -Small”, 0.5し0.75し0.25)i ConicalFrustum example2 = new conica!Frustum (“Medium”, 5.1, 10.2, 15.9); ConicalFrustum example3-new ConicalFrustum(“Large, 98.32, 199.0, 250.0) (3) Methods: Usually a class provides methods to access and modify each of its instance variables (known as get and set methods) along with any other required methods. The methods for ConicalFrustum, which should each be public, are described below. See the formulas in the figure above and the Code and Test section below for information on constructing these methods. o getLabel: Accepts no parameters and returns a String representing the label field. o setLabel: Takes a String parameter and returns a boolean. If the String parameter is not null, then the trimmed” String is set to the label field and the method returns true. Otherwise, the method returns false and the label is not set o getRadiusl: Accepts no parameters and returms a double representing the radiusl o setRadiusl: Takes a double parameter and returns a boolean. If the double field parameter is non-negative, then the parameter is set to the radius1 field and the method returns true. Otherwise, the method returns false and the radiusl field is not set. o getRadius2: Accepts no parameters and returns a double representing the radius2 field. setRadius2: Takes a double parameter and returns a boolean. If the double parameter is non-negative, then the parameter is set to the radius2 field and the method returns true. Otherwise, the method returns falseand the radius2 field is not set. o o getHeight: Accepts no parameters and returns a double representing the height field Show transcribed image text