Question: I have no idea how to start, please help me.. Objective - To exercise some of the Python's interactive I/O formatting options to compose, manipulate

I have no idea how to start, please help me..I have no idea how to start, please help me.. Objective -

Objective - To exercise some of the Python's interactive I/O formatting options to compose, manipulate and format computed values of a user-defined (a.ka, "custom) class that models a Sphere. Specifications - Define some global functions that will take a number and output it to the screen using decimal, hexadecimal, scientific, or binary notation depending on the characteristic being output (see sample output below). The values passed to these global functions will be values returned methods from of a user-defined Sphere class. Given an object of a Sphere class with a single instance variable, Radius, define methods in the class that compute and return values for the Circumference and volume of the object. Using this class and the global functions, print out the data in columns for spheres that have radii of (as a minimum) 20 to 30 in increments of 1 unit. The output should look something like the following (NOTE the centering between the margins required for the first three lines of output; RADIUS+++++++++++++++++++++VOLUME+ ++ ++++++RADIUS -CIRCUMFERENCE HEXIDECIMAL SCIENTIFIC DECIMAL BINARY 3.35e+04 20. 21 Ob00010100. Ob00010101 .0x7d. .0x83. 3.88e+04 -------- cont. End Output Lab 1. Design - Five global formatting functions, one user-defined class (Sphere, and a main) test driver global function are involved. The Sphere class encapsulates the necessary data item and methods to manage this data item and accomplish the calculations for a Sphere object. The global formatting functions receive a decimal number parameter and cause it to be formatted in the appropriate form and the formatted form then returned. Global Functions: def formatDecimal(InNur )... def formatHex(InNum):... def formatBinaryInNum, NumDigits):... def formatScientific(InNum):. Class Sphere: Il : methods definit(self, inRadius 0): def setRadius selfnewRadius): def getRadius(self: def calcCircumference(self:. .. def calcVolume(self:... Wl instance variable: self radius (defined & initialized in init _(...)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!