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...
-
Post what you believe to be UMass-Dartmouth's core competencies that are at the heart of UMass-Dartmouth's competitive advantage. If you believe UMD does not have any core competencies, state what...
-
The data in Toys R Us are quarterly revenues (in $millions) for Toys R Us from 1996-Q1 through 2017-Q1. Source: Data extracted from Standard & Poors Stock Reports, November 1995, November 1998, and...
-
Consider the following cash flow profile, and assume MARR is 10 percent/year and the finance rate is 4 percent/year. a. Determine the MIRR for this project. b. Is this project economically...
-
The Vest School of Vocational Technology has organized the school training programs into three departments. Each department provides training in a different area as follows: nursing assistant, dental...
-
18) A physician prescribes one 0.7 mg tablet of a medication to be taken twice a day for 15 days. How many total mcg of the medication will the patient have taken after 15 days?
-
On January 1, 2024, Presidio Company acquired 100 percent of the outstanding common stock of Mason Company. To acquire these shares, Presidio issued to the owners of Mason $200,000 in long-term...
-
The folowing are the competing hypotheses and the relevant summary statistics. Sample 1 S= 415 i 10 Sanple 2 S=323 The pvalue associated with the value of the test statistic is 03692. At the 5%...
-
1 Euro is currently trading at 38 Thai Baht. 1 Thai Baht is currently trading at .04 Canadian Dollar. If triangular arbitrage holds, the value of the Euro in terms of the Canadian Dollar is ____?...
-
Suppose someone wants to accumulate $40,000 for a college fund over the next 15 years. Determine whether the following investment plans will allow the person to reach the goal. Assume the compounding...
-
A preferred stock will pay a dividend of $3.50 in the upcoming year and every year thereafter; i.e., dividends are not expected to grow. You require a return of 11% on this stock. Use the constant...
-
Your bank offers you a 36-month, 3% APR car loan for a $56000 new Mercedes SLK300 Roadster. What will your monthly payment be? Your Answer: Answer
-
A company's bonds have a face value of $1,000. The bonds carry a 8% coupon, pay interest semiannually, and mature in 7 years. What is the current value of these bonds if the yield to maturity is...
-
Jelly Inc. is considering an investment. It will produce FCF of $200 million at the end of each of the next 2 years (year 1 and year 2). This investment costs $50 million today. The project will end...
-
In your readings, there were many examples given for nurturing close family relationships in this ever-evolving technological society we live in Based upon your readings and research describe three...
-
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...
-
From the following trial balance of G. Foot after his first year's trading, you are required to draw up a statement of profit or loss for the year ending 30 June 2016. A statement of financial...
-
At the beginning of the financial year on 1 April 2017, a company had a balance on plant account of 372,000 and on provision for depreciation of plant account of 205,400. The company's policy is to...
-
What circumstances might lead you to write-off a debt as bad and not close the debtor's account?
Study smarter with the SolutionInn App