Question: It's java code thank you Question-1 (100 Points) 1. Create a class named Hemisphere. 2. The class has one attribute, radius. The attribute is set
Question-1 (100 Points) 1. Create a class named Hemisphere. 2. The class has one attribute, radius. The attribute is set to 1 in the default constructor. The attributes should only be visible in the dass. 3. Create another fully parameterized constructor that takes the attribute as a parameter. 4. Provide set and get methods for all attributes. The set methods should verify that the values are positive. Never allow negative values for any attribute. 5. Provide two methods to calculate the surface area and the volume of the square pyramid according to the formulas shown below. Volume: 2/3 *** Total Surface Area: A=3* **p? 6. Provide a utility method (getDetails) that returns a formatted string about the details of the hemisphere object. It should print the radius, surface area, and volume each in a separate line with a proper message. All values should be set to two decimal places. See sample output Hemisphere radius: 3.00 Surface Areas 84.82 Volumes 56.55 7. Write a tester program to test the Hemisphere class. a) Create two different objects in it. Use a different constructor for each of them. Set their parameters. b) Print the details of both objects
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
