Write a while loop that prints user_num divided by 2 until user_num is less than 1....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a while loop that prints user_num divided by 2 until user_num is less than 1. The value of user_num changes inside of the loop. Sample output with input: 20 10.0 5.0 2.5 1.25 0.625 Note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds and report "Program end never reached." The system doesn't print the test case that caused the reported message. Code writing challenge activity demo 456578.3058726.qx3zqy7 1 user_num= int(input()) 2 while user num>=1: 3 4 5 print (user_num/2) x-float(input()) user_num= x Write a while loop that prints user_num divided by 2 until user_num is less than 1. The value of user_num changes inside of the loop. Sample output with input: 20 10.0 5.0 2.5 1.25 0.625 Note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds and report "Program end never reached." The system doesn't print the test case that caused the reported message. Code writing challenge activity demo 456578.3058726.qx3zqy7 1 user_num= int(input()) 2 while user num>=1: 3 4 5 print (user_num/2) x-float(input()) user_num= x
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Monty Park was started on April 1 ?by R . ?S . ?Francis and associates. The following selected events and transactions occurred during April. Apr. 1 ?Stockholders invested $ 4 9 , 3 0 0 ?cash in the...
-
Prove that function f given by f(x) = log (cos x) is strict TC and strictly increasing on ( TO 2 decreasing on 0, (0, 7) 2
-
Write an expression that executes the loop body as long as the user enters a non-negative number. Note: These activities may test code with different test values. This activity will perform three...
-
Molybdenum forms a substitutional solid solution with tungsten. Compute the weight percent of molybdenum that must be added to tungsten to yield an alloy that contains 1.0 10 22 Mo atoms per cubic...
-
Determine the angular momentum HO of the disk of Sample Prob. 18.2 from the expressions obtained for its linear momentum mv and its angular momentum HG, using Eqs. (18.11). Verify that the result...
-
Noah Yobs, who has $62,000 of AGI (solely from wages) before considering rental activities, has $70,000 of losses from a real estate rental activity in which he actively participates. He also...
-
Why is it important to estimate the benefits to be derived from new HRIS functionality before you estimate the costs? If costs were estimated first, how might this change the analysis?
-
Following is a list of cost system characteristics and sample companies. Match each to either job order costing or process costing. a. Companies that produce small quantities of many different...
-
Winner Company stocks interior pre-hung doors purchased from a vendor from China. A typical door is purchased for $44.50 and sells for $58. It is estimated that the cost of order processing and...
-
Background: In the initial contract negotiation stage, the contract price with SM was $10.1 million in cash. However, as part of the final contract negotiations, SM agreed to give EYE SPY its old...
-
What flexibility does irrevocable and irrevocable trust offer that other trusts do not? What are its advantages and disadvantages of irrevocable and irrevocable trust?
-
"Differences Between FHA , VA, CONVENTIONAL , 2.which loan you would advise your clients to use if they were going to buy a house valued at $150,000 and WHY. They are both veterans andhave a credit...
-
1. Sawyer buys Stock XYZ for $50 and a 6-month floor with a strike price of $50 for a $3.42 premium. Jack buys a call option on Stock XYZ with a strike price of $50. The risk-free rate is 6%...
-
a. Compute the beta coefficients for Intel, Ford, Anheuser Busch and Merck. (8 marks) b. Assuming a risk-free rate of 8 percent and an expected return for the market portfolio of 15 percent, compute...
-
Tuja Ltd a book manufacturing company has a debt-to-equity ratio of 0.4. It is considering building a new $58 million manufacturing facility which would generate after-tax cash flow of $6.2 million...
-
Suppose firm has returns of 8 percent, -12 percent, 14 percent, -15 percent, 16 percent, and 26 percent for six of the last seven years. If the average return of the share return over this period is...
-
C2D3 has a solubility product constantof 9.1410?99.1410?9. What is the molar solubilityof C2D3? Express your answer with the appropriate units. Molar solubility= 6.89 *10^-39. What are the units?
-
The following items were displayed in the statement of affairs for Lubbock Company: Fully secured liabilities ......... $90,000 Partially secured liabilities ....... 12,000 Unsecured liabilities...
-
Jim (age 50) and Martha (age 49) are married with three dependent children. They file a joint return for 2012. Their income from salaries totals $50,000, and they received $10,000 in taxable...
-
Kent Pham, CPA, is a 45-year-old single taxpayer living at 169 Trendie Street, La Jolla, CA 92037. His Social Security number is 865-68-9635. In 2012, Kent's W-2 as the controller of a local...
-
Fisafolia Corporation has gross income from operations of $220,000 and operating expenses of $160,000 for 2012. The corporation also has $20,000 in dividends from publicly traded domestic...
-
The following data from Lyre Ltd's accounts relates to two assets at 30 June 2023. At 30 June 2023 Lyre Ltd decides to adopt the revaluation model for both these assets. On this date land has a fair...
-
On 1 January 2023, Blue Jay Ltd revalued land from \(\$ 300000\) to \(\$ 500000\). On 1 January 2024, the company subsequently revalued the land to \(\$ 420000\). And on 1 January 2025 , the company...
-
Seagull Ltd purchased land for use as its corporate headquarters. A small factory that was on the land when it was purchased was torn down before construction of the office building began....
Study smarter with the SolutionInn App