Radioactive materials decay over time and turn into other substances. For example, Carbon-14 decays into Nitrogen-14...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Radioactive materials decay over time and turn into other substances. For example, Carbon-14 decays into Nitrogen-14 through beta decay. The rate of radioactive decay of a material is measured in terms of its half-life. The half-life of a material is defined to be the amount of time it takes for half of the material to undergo radioactive decay. Let m be the initial mass in grams of some material and let h be the material's half-life in days. Then the remaining mass of the material on day t, denoted m(t), is given by the formula: m(t) = m x0.5"h Note: This formula is not a Python assignment statement. It is an equation that says: if you know the quantities m, r, and h, you can calculate a value using the right side of the equation. That value will be the amount of remaining mass of the material after + days. For this question, create a program which does the following: Prompt the user to enter the initial mass of the material (in grams). You must make sure that the user enters a positive number. If they do not enter a positive number, print a message informing them so, and prompt them to enter the initial amount of material again. Keep doing this until they enter a positive number. • Prompt the user to enter the half-life of the material (in days). As above, make sure that the user enters a positive number, and if they don't, keep asking until they do. Starting from day 0, output the amount of the material remaining at one-day intervals. Thus, for day 0, day 1, day 2, etc., you should print out the amount of remaining mass according to the above formula. Your program should stop on the first day on which remaining mass is less than 1% of the initial mass. Don't forget to import the math module if you need any non-built-in Python math functions. Hint: You can use two separate while-loops to ensure that the user enters correct values for a) the initial mass and b) the half-life You can also use another while-loop to calculate and display the remaining mass on a daily basis. Test your program with h = 3 and m - 80 and make sure the output is identical to the sample output. Then test your program with h = 2 and m= 100. Make sure the output makes sense! Then test your program once more with inputs of your choice - these should be unique to you and unlikely to be chosen by two different students. Do not use too large a value for h, or your program will produce very long outputs. Radioactive materials decay over time and turn into other substances. For example, Carbon-14 decays into Nitrogen-14 through beta decay. The rate of radioactive decay of a material is measured in terms of its half-life. The half-life of a material is defined to be the amount of time it takes for half of the material to undergo radioactive decay. Let m be the initial mass in grams of some material and let h be the material's half-life in days. Then the remaining mass of the material on day t, denoted m(t), is given by the formula: m(t) = m x0.5"h Note: This formula is not a Python assignment statement. It is an equation that says: if you know the quantities m, r, and h, you can calculate a value using the right side of the equation. That value will be the amount of remaining mass of the material after + days. For this question, create a program which does the following: Prompt the user to enter the initial mass of the material (in grams). You must make sure that the user enters a positive number. If they do not enter a positive number, print a message informing them so, and prompt them to enter the initial amount of material again. Keep doing this until they enter a positive number. • Prompt the user to enter the half-life of the material (in days). As above, make sure that the user enters a positive number, and if they don't, keep asking until they do. Starting from day 0, output the amount of the material remaining at one-day intervals. Thus, for day 0, day 1, day 2, etc., you should print out the amount of remaining mass according to the above formula. Your program should stop on the first day on which remaining mass is less than 1% of the initial mass. Don't forget to import the math module if you need any non-built-in Python math functions. Hint: You can use two separate while-loops to ensure that the user enters correct values for a) the initial mass and b) the half-life You can also use another while-loop to calculate and display the remaining mass on a daily basis. Test your program with h = 3 and m - 80 and make sure the output is identical to the sample output. Then test your program with h = 2 and m= 100. Make sure the output makes sense! Then test your program once more with inputs of your choice - these should be unique to you and unlikely to be chosen by two different students. Do not use too large a value for h, or your program will produce very long outputs.
Expert Answer:
Answer rating: 100% (QA)
PYTHON import math def getpositiveinputprompt while True ... View the full answer
Related Book For
Elementary Principles of Chemical Processes
ISBN: 978-1119498759
4th edition
Authors: Richard M. Felder, ? Ronald W. Rousseau, ? Lisa G. Bullard
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Question 3: (a) A GMPE predicts a median peak horizontal acceleration of 0.4 g. If the standard deviation in In units is 0.5, what is the 84th percentile estimate for the peak horizontal...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Bollobs and Chung proposed a hybrid model that combines a 2-ring on \(V\) vertices ( \(V\) is even), plus a random matching. A matching is a graph in which every vertex has degree 1. To generate a...
-
On June 1, 2013, Dirty Harry Co. borrowed cash by issuing a 6-month noninterest-bearing note with a maturity value of $480,000 and a discount rate of 7%. Assuming straight-line amortization of the...
-
Whats your assessment of Ivy Lees work for the Rockefeller family in the Colorado Fuel & Iron Company strife? Do you think his approach was sound? What would you have done differently?
-
Write-Off of Uncollectible Accounts \section*{CORNERSTONE 5.2} The Rock has credit sales of \(\$ 500,000\) during 2018 and estimates at the end of 2018 that \(2 \%\) of these credit sales will...
-
National Scan, Inc., sells radio frequency inventory tags. Monthly sales for a seven- month period were as follows: Month Sales (000 units) Feb. . 19 Mar. . 18 Apr. . 15 May . 20 Jun. . 18 Jul. . 22...
-
Which of the following would be included in the barse cost of an asset, for CGT purposes? Select more than one: a . Cost of improvements to the asset b . Cost of repairs to the asset c . Cost of...
-
write two pages review for the article The 4 dimensions of digital trust, charted across 42 countries by Bhaskar Chakravorti, Ajay Bhalla, and Ravi Shankar Chaturvedi to give a personal opinion about...
-
You have won a contract to write and supply some software and set up a company to do so. The contract is worth $250,000, with 30% payable at start, 20% at a milestone expected to be completed in...
-
Complete the table below using the relevant apportionment method along with the most appropriate allocation base for each service department. Construction Varnishing Maintenance Canteen Number of...
-
On January 1, 2023, Janna has a tax basis of $18,000 in her Mimikaki stock (Mimikaki has been an S corporation since inception). In 2023, Janna was allocated $23,000 of ordinary income from Mimikaki....
-
a) What are the benefits of private equity? What are the drawbacks? (2pts) Benefits of Private Equity - Higher Returns Potential: Private equity investments often aim for higher returns compared to...
-
Why has Operation Opportunity been a success for Hilton? The Hilton uses technology to screen candidates, so how do they bring that same "light and warmth" to the candidate experience?
-
If Maybelle decided to divide the $20,000 equally and deposit it into the RSP account and the TFSA account, what would be her immediate and future tax advantages be due to her RSP contribution? What...
-
Use differentials to approximate the value of the expression. Compare your answer with that of a calculator. (Round yo answers to four decimal places.) (2.99)3 using differentials using a calculator X
-
Currently, there are five concepts of food stands, including: hot dogs, soft pretzels, turkey legs, sandwich wraps, and funnel cakes. This approach will double the existing number of food stands...
-
Table B.7 of Appendix B gives the following values for steam at 400C and 150 bar: (a) The value 2975 is not the true specific enthalpy of steam at the given condition. Why not? State the process [H 2...
-
According to Archimedes' principle, the mass of a floating object equals the mass of the fluid displaced by the object. Use this principle to solve the following problems. (a) A wooden cylinder 30.0...
-
An ultimate analysis of a coal is a series of operations that yields the percentages by mass of carbon, hydrogen nitrogen, oxygen and sulfur in the coal. The heating value of a coal is best...
-
Explain what is meant by feedforward control and distinguish it from feedback control. R-1
-
Computing Ending Balance of Retained Earnings LO1-1 Sultan Inc. was organized on January 1, 2020. It reported the following for its first two years of operations: Required: Compute the ending balance...
-
What is meant by a variance? What is the point in analysing variances? R-2
Study smarter with the SolutionInn App