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...
-
(a) Derive a differential equation for predicting the capsule temperature as a function of time. Solve this equation to obtain the temperature as a function of time in terms of capsule parameters and...
-
Use ten iterations to estimate the largest eigenvalue of these matrices, starting from the vector with components 1, 2, and 3. Compare the answer with the one obtained by solving the characteristic...
-
Figure P28.44 shows a very long wire that carries a current \(I\) in the \(z\) direction and is centered in the \(x y\) plane at the position \((0,0)\). The line integral of the magnetic field along...
-
Sara Chung knew the construction contractors in her area well. She was the purchasing manager at the power plant, a business that was the major employer in the region. Whenever a repair or...
-
6. For the given first order reaction 7. AB The half life of the reaction is 0.3010 min. The ration of the initial concentration of reactant to the concentration of reactant at time 2.0 min will be...
-
Review the problem in the Work It Out titled "Interpreting the AD/AS Model." Like the information provided in that feature, Table 24.2 shows information on aggregate supply, aggregate demand, and the...
-
: The damped oscillations may defined as The energy of the oscillator may reduced each periodic time. There is a No drag force acting against the oscillatory motion. The amplitude of oscillation...
-
(a) Calculate the current ratio if current assets are 50,000 and current liabilities are 30,000. (b) If inventory is 28,000, what is the acid test ratio?
-
Malcolm Phillips is a sole trader who prepares his financial statements annually to 30 April. His summarised statements of financial position for the last two years are shown below. Malcolm is...
-
The statement of financial position of A. Barnes and C. Darwin at 31 March 2011 is as follows: The partners share profits and losses: Barnes three-fifths and Darwin two-fifths. At the date of the...
-
Wilson, Player and Sharp are in partnership. They shared profits in the ratio 2:4:3. It is decided to admit Titmus. It is agreed that goodwill is worth 72,000 and that it is to be brought into the...
-
Bee, Cee and Dee have been holding preliminary discussions with a view to forming a partnership to buy and sell antiques. The position has now been reached where the prospective partners have agreed...
-
To determine if you are a Type A personality, click on the linkbelow and complete the free Type A personality test. When finishedread what the website has to say about Type A and Type Bpersonalities...
-
Reduction in sales All of the above 29. Belt of an electric motor is broken, it needs a. Corrective maintenance b. Scheduled maintenance c. Preventive maintenance d. Timely maintenance. 30. The...
-
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...
-
For an object in curvilinear motion, (a) the objects velocity components are constant, (b) the y-velocity component is necessarily greater than the x-velocity component, (c) there is an acceleration...
-
A football is thrown on a long pass. Compared to the balls initial horizontal velocity component, the velocity at the highest point is (a) greater, (b) less, (c) the same.
-
On Cartesian axes, the x-component of a vector is generally associated with a (a) cosine, (b) sine, (c) tangent, (d) none of the foregoing.
Study smarter with the SolutionInn App