Write a program the reads from the user a real number. Then your program displays 2...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program the reads from the user a real number. Then your program displays 2 choices to the user. 1- get the square of input 2- get square root of input Based on the user's choice, the program finds the result and displays it. Take care of wrong choice and error message in case the user wants square root of negative number. Sample runs Enter a real number > 5.28 1- get square of input 2- get square root of input Enter your choice > 3 wrong choice Enter a real number > -12.5 1- get square of input 2- get square root of input Enter your choice > 1 square of -12.50 = 156.25 Slide Type Write a program the reads from the user a real number. Then your program displays 2 choices to the user. 1- get the square of input 2- get square root of input Based on the user's choice, the program finds the result and displays it. Take care of wrong choice and error message in case the user wants square root of negative number. Sample runs Enter a real number > 5.28 1- get square of input 2- get square root of input Enter your choice > 3 wrong choice Enter a real number > -12.5 1- get square of input 2- get square root of input Enter your choice > 1 square of -12.50 = 156.25 Slide Type
Expert Answer:
Answer rating: 100% (QA)
import math def getuserchoice while True try choice intinput1 Get square of input2 Get square ... View the full 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
-
QUESTION 1 a. Illustrate how web analytics and the online purchasing process happen? [10marks] a. Discussed on Social Network Features and Technology. [10marks] a. Explain and give examples of how...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Establish procedures to guarantee substantiation of claims for allowances. Think about how you would set up a process to ensure employee claims and allowances could be claimed. Write a step by step...
-
A5.00-g quantity of a diprotic acid was dissolved in water and made up to exactly 250 mL. Calculate the molar mass of the acid if 25.0 mL of this solution required 11.1 mL of 1.00 M KOH for...
-
Let Y 1 < Y 2 < < Y n be the order statistics of a random sample of size n from a distribution with pdf where < 1 < and 0 < 2 < . Find the joint minimal sufficient statistics for 1 and 2 ....
-
Although physically counting a businesss inventory is integral to the periodic system of inventory recordkeeping, it is not an explicit component of the perpetual system. Nonetheless, most well-run...
-
You are the vice president of finance for Exploratory Resources, headquartered in Houston, Texas. In January 2010, your firms Canadian subsidiary obtained a six-month loan of 150,000 Canadian dollars...
-
2 ) What is 'financialization'? ( You can be quite brief in defining this and giving examples ) . 3 ) How and why has financialization affected the management strategies of NON - FINANCIAL companies...
-
Kepler's second law states that as a planet moves around in its orbit, it sweeps out equal areas in equal times. Examine the following figure, which shows a planet (blue dot, labeled "E"), orbiting...
-
In 2017, Herald and Megan purchased Series EE bonds, and in 2021 redeemed the bonds, receiving $660 of interest and $2.940 of principal. Their income from other sources totaled $38,000. They paid...
-
In a differential wheel and axle, the diameter of the larger axle is 250 mm and that of the smaller 225 mm. The diameter of effort wheel is 500 mm. Find the velocity ratio. If an effort of 150 N...
-
Air flows in a 15-cm-diameter horizontal pipe. At section 1, \(p=600 \mathrm{kPa}, T=70{ }^{\circ} \mathrm{C}\), and \(V=35 \mathrm{~m} / \mathrm{s}\). At section 2: \(T=42^{\circ} \mathrm{C}\) and...
-
Philip and Lance have decided to form a partnership by investing \($100000\) and \($80000\) respectively. The following plans for dividing profits and losses are under consideration. Sharing profits...
-
Determine the stiffness matrix for a \([+45 /-45]\) antisymmetric laminate consisting of 0.25-mm-thick unidirectional AS/3501 carbon/epoxy plies.
-
What is the method where a product solution is assumed for the free vibrations of a uniform bar called? Is the same method applicable to the free vibrations of a beam?
-
Wanda Zackery was extremely excited a year ago when she joined Landon Electronics as its first safety engineer. She had graduated from Florida State University with a degree in electrical engineering...
-
d) For die casting processes: 1. What are the most common metals processed using die casting and discuss why other metals are not commonly die casted? 2. Which die casting machines usually have a...
-
In 2012, Lou has a salary of $54,000 from her job. She also has interest income of $1,700. Lou is single and has no dependents. During the year, Lou sold silver coins held as an investment for a...
-
Sherry rents her vacation home for 6 months and lives in it for 6 months during the year. Her gross rental income during the year is $4,000. Total real estate taxes for the home are $950, and...
-
Van makes an investment in a partnership in 2012. Van's capital contributions to the partnership consisted of $30,000 cash and a building with an adjusted basis of$70,000, subject to a nonrecourse...
-
Champion Company is considering a contract that would require an expansion of its food processing capabilities. The contract covers five years. To provide the required products, Champion would have...
-
Below is a list of aspects of various capital expenditure proposals that the capital budgeting team of Anchor, Inc., has incorporated into its net present value analyses during the past year. Unless...
-
Clancy Company is considering the purchase of equipment for \($100,000\). The equipment will expand the companys production and increase revenue by \($30,000\) per year. Annual cash operating...
Study smarter with the SolutionInn App