Design and implement a class called sphere


.1- Sphere
Design and implement a class called Sphere that contains instance data that represents the sphere's diameter. Define the Sphere constructor to accept and initialize the diameter, and include getter and setter methods for the diameter. Include methods calcVolume and calcSurfaceArea that calculate and return the volume and surface area of the sphere. Include a toString method that returns a one-line description of the sphere of this form:
sphere with diameter X
where X is the object 's diameter rounded to 3 decimal places. 

Use the following formulas in your class :
Volume = 4/3 PI times cube of the radius
Surface Area = 4 PI times the square of the radius
____________________________________________________________________________________________________________________


2: Histogram 
Design and implement an application that creates a histogram that allows you to visually inspect the frequency distribution of a set of values . The program should read in an arbitrary number of integers that are in the range 1 to 100 inclusive; then produce a chart similar to the one below that indicates how many input values fell in the range 1 to 10, 11 to 20, and so on. Print one asterisk for each value entered.

1 - 10 | *****
11 - 20 | ****
21 - 30 | *********
31 - 40 | **
41 - 50 | **************
51 - 60 | ******
61 - 70 | ****
71 - 80 | ********
81 - 90 | *
91 - 100 | *** 

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Design and implement a class called sphere
Reference No:- TGS081728

Expected delivery within 24 Hours