12 # Use the following information to answer the question: 13 # The radius of a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
12 # Use the following information to answer the question: 13 # The radius of a ping pong ball is .02 meters 14 4555 W 5 15 16 # # # # The volume of an Boeing 747 airplane is 1035 cubic meters The formula for the volume of a sphere: `volume_sphere = (4/3)* PI * radius^3* You may estimate the value of PI to be 3.14 17 18 # As part of your solution, complete the implementation of the template 19 # function "volume_of_sphere (). The function should take a number as input # and return the volume based on the formula given above. Round all numeric # values to two decimal places. 20 21 22 # 23 # Write the remaining program that calls the function to compute the final # solution. Round the number of ping pong balls down to the nearest integer 24 25 # to ensure that they will all fit inside. Use best coding practices 26 # throughout your solution. 27 # 28 # Print your final answer to the standard output console using the following 29 # format. 30 # 31 # XXX ping pong balls can fit into a Boeing 747 airplane. 32 # 33 34 35 def volume_of_sphere (radius): 30 31 # # # # XXX ping pong balls can fit into a Boeing 747 airplane. 32 33 34 35 36 37 38 39 40 41 42 43 # Test your volume_of_sphere() calculations using the following asserts 44 assert round(volume_of_sphere (1), 2) == 4.19 45 assert round(volume_of_sphere (10), 2) == 4186.67 46 assert round(volume_of_sphere (10), 2) != 4186.6667 def volume_of_sphere (radius): """Calculate the volume of a sphere with a given radius""" # Finish this function 12 # Use the following information to answer the question: 13 # The radius of a ping pong ball is .02 meters 14 4555 W 5 15 16 # # # # The volume of an Boeing 747 airplane is 1035 cubic meters The formula for the volume of a sphere: `volume_sphere = (4/3)* PI * radius^3* You may estimate the value of PI to be 3.14 17 18 # As part of your solution, complete the implementation of the template 19 # function "volume_of_sphere (). The function should take a number as input # and return the volume based on the formula given above. Round all numeric # values to two decimal places. 20 21 22 # 23 # Write the remaining program that calls the function to compute the final # solution. Round the number of ping pong balls down to the nearest integer 24 25 # to ensure that they will all fit inside. Use best coding practices 26 # throughout your solution. 27 # 28 # Print your final answer to the standard output console using the following 29 # format. 30 # 31 # XXX ping pong balls can fit into a Boeing 747 airplane. 32 # 33 34 35 def volume_of_sphere (radius): 30 31 # # # # XXX ping pong balls can fit into a Boeing 747 airplane. 32 33 34 35 36 37 38 39 40 41 42 43 # Test your volume_of_sphere() calculations using the following asserts 44 assert round(volume_of_sphere (1), 2) == 4.19 45 assert round(volume_of_sphere (10), 2) == 4186.67 46 assert round(volume_of_sphere (10), 2) != 4186.6667 def volume_of_sphere (radius): """Calculate the volume of a sphere with a given radius""" # Finish this function
Expert Answer:
Answer rating: 100% (QA)
def volumeofsphereradius pi314 vol4piradius 33 return roundvol2 assert roundvolumeof... View the full answer
Related Book For
Fundamental Accounting Principles Volume II
ISBN: 978-1259066511
14th Canadian Edition
Authors: Larson Kermit, Jensen Tilly
Posted Date:
Students also viewed these programming questions
-
Use the following information to complete Keith and Jennifer Hamilton's 2015 federal income tax return. If information is missing, use reasonable assumptions to fill in the gaps. Form 1040,...
-
What is the spring cloud API Gateway and how do you set it up to make a call to the product service via eureka service discovery server? Give me the complete code in detailed steps.
-
A bartender employed in a licensed establishment over-serves a patron. As a result of the over-service, the patron physically assaults another patron by striking him with a beer bottle. Identify and...
-
The following data were summarized from the accounting records for Jersey Coast Construction Company for the year ended June 30, 20Y8: Prepare divisional income statements for Jersey Coast...
-
The partially completed table that follows shows the distribution of scores on the 2016 AP Statistics exam. Suppose we randomly select a student who took this exam. Whats the probability that he or...
-
Lingham Company's fiscal year ends on April 30, and the company's certified public accountant, Sanders \& Stein, conducts the annual audit during May and June. Sanders \& Stein has prepared audit...
-
Sommer Graphics Company was organized on January 1, 2015, by Krystal Sommer. At the end of the first 6 months of operations, the trial balance contained the accounts shown below. Analysis reveals the...
-
A manufacturer reports direct materials of $5 per unit, direct labor of $2 per unit, and variable overhead of $3 per unit. Fixed overhead is $168,000 per year, and the company estimates sales of...
-
The most recent financial statements for Crosby, Incorporated, follow. Interest expense will remain constant, the tax rate and the dividend payout rate will also remain constant. Costs, other...
-
7.) 3 pts. Write the RegExp that matches only the complete HEX number of length 3 or 6. Each number should be in its own line. Some good examples are: #1f1f1F, #AFAFAF, #1AFFal, # 222fff, #F00 But...
-
i) write up to four acceptable Lewis structures for the major resonance form(s). Indicate all non-zero formal charges. Indicate which resonance form is the most important contributor when there is...
-
Assignment is to be typed on the "Incident Report Form" template. Assignment Summary: You are playing the role of a "Loss Prevention Investigator" at a retail store who just witnessed a theft in your...
-
The reaction of a-pinene oxide with aqueous acid includes a complex rearrangement. What would the reaction look like if a simpler molecule-cyclohexene oxide - reacted with aqueous acid and no...
-
Breno has a group extended health coverage plan with an annual coverage limit of $3,500, a deductible of $500, and a coinsurance factor of 70%. Breno incurs $2,000 of eligible medical expenses in the...
-
The Hotel Front Desk the Nerve Center of Customer Service Delivery! The hotel front desk is the nerve center and the dispatcher for customer service inquiries of all types. Although a large portion...
-
Shutter, Inc. is a manufacturer of digital cameras. It has two departments: assembly and testing. In January 2017, the company incurred $780,000 on direct materials and $810,000 on conversion costs,...
-
1. Advertising for eyeglasses _________ (increases/decreases) the price of eyeglasses because advertising promotes _________. 2. An advertisement that succeeds in getting consumers to try the product...
-
Min Industries had selected unadjusted balances as shown below at year-end. A search on the Internet showed fair values on December 31, 2014, of: CashCo, $18; Wells, $0.70. Prepare the appropriate...
-
Dallas and Weiss began a partnership by investing $115,000 and $135,000, respectively. During its first year, the partnership recorded net income of $394,000. Required Prepare calculations showing...
-
Keith Scott and David McPeek agreed to share the annual net incomes or losses of their partnership as follows: If the partnership earned a net income, the first $60,000 would be allocated 40% to...
-
True or False. The element stiffness matrices are always singular.
-
Derive the stiffness matrix of the bar element in longitudinal vibration whose cross-sectional area varies as \(A(x)=A_{0} e^{-(x / l)}\), where \(A_{0}\) is the area at the root (see Fig. 12.14)....
-
Fill in the Blank. In the finite element method, the elements are assumed to be interconnected at certain points known as ____________ .
Study smarter with the SolutionInn App