Q-3 [30 pts] In this question, you will experimentally verify the sensitivity of using a precise...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Q-3 [30 pts] In this question, you will experimentally verify the sensitivity of using a precise Pi to the accuracy of computing the area of a circle. You need to perform the following activities with a Python program: 1. Ask the user to input a radius value. It may be an integer or a float. 2. Compute the area of a circle with that radius using Pi from the Python Math Library. Assign the area to a variable, say realA. 3. Now compute the area of the circle using the Pi value with precision 1,2, and 3 points after the decimal place. (i.e., Pi = 3.1, 3.14 & 3.141). Then print the percentage difference between each of the areas calculated using each of these values of Pi and realA. Note: Difference is: Area from Math Library - Area you calculate with Pl = 3.xxx Example input: Please enter a radius value: 7.1 Example output: The real area of the circle is: 158.36768566746144 with pi= 3.1, percentage difference 1.3239352830248852 % with pi= 3.14, percentage difference 0.05069573828972128 % with pi= 3.141, percentage difference 0.018864749671345722 % Save & Run 10/3/2023, 11:21:14 PM - 2 of 2 Show in CodeLens Q-3 [30 pts] In this question, you will experimentally verify the sensitivity of using a precise Pi to the accuracy of computing the area of a circle. You need to perform the following activities with a Python program: 1. Ask the user to input a radius value. It may be an integer or a float. 2. Compute the area of a circle with that radius using Pi from the Python Math Library. Assign the area to a variable, say realA. 3. Now compute the area of the circle using the Pi value with precision 1,2, and 3 points after the decimal place. (i.e., Pi = 3.1, 3.14 & 3.141). Then print the percentage difference between each of the areas calculated using each of these values of Pi and realA. Note: Difference is: Area from Math Library - Area you calculate with Pl = 3.xxx Example input: Please enter a radius value: 7.1 Example output: The real area of the circle is: 158.36768566746144 with pi= 3.1, percentage difference 1.3239352830248852 % with pi= 3.14, percentage difference 0.05069573828972128 % with pi= 3.141, percentage difference 0.018864749671345722 % Save & Run 10/3/2023, 11:21:14 PM - 2 of 2 Show in CodeLens
Expert Answer:
Answer rating: 100% (QA)
Python program that implements the described activities python import math Step 1 Ask ... View the full answer
Related Book For
Managerial Accounting Decision Making and Performance Management
ISBN: 978-0273764489
4th edition
Authors: Ray Proctor
Posted Date:
Students also viewed these programming questions
-
Cream Co has two foreign branches who income is earned through active business operations, IE the income is not passive. High Tax Branch earned 6 million of taxable income and paid 1.8 million in...
-
I need a report with a specific product from a company Assessment 3: Individual Assignment Marking Criteria Report: Structure and Marking Criteria Executive Summary (5 marks) A well written...
-
Jessica lives with her parents and attends the local state college. The local state college is operated by the state government, and tuition is free. Jobs that pay $10 an hour are available to high...
-
A solid of constant density is bounded below by the plane z = 0, on the sides by the elliptical cylinder x 2 + 4y 2 = 4, and above by the plane z = 2 - x. a. Find x and y. b. Evaluate the integral...
-
An atomic clock moves at 1 000 km/h for 1.00 h as measured by an identical clock on the Earth. How many nanoseconds slow will the moving clock be compared with the Earth clock, at the end of the...
-
A 74.6-g ice cube fl oats in the Arctic Sea. The temperature and pressure of the system and surroundings are at 1 atm and 0C. Calculate Ssys, Ssurr, and Suniv for the melting of the ice cube. What...
-
Which of the following statements is false? (a) The shortage of nursing professionals is expected to decrease in the coming decade. (b) Studies have shown an association between electronic health...
-
Marys Ice Cream Shoppe sold 9,100 servings of ice cream during June for $4 per serving. Mary purchases the ice cream in large tubs from the Organic Ice Cream Company. Each tub costs Mary $14 and has...
-
1: Explain what happens to create regional and contact metamorphism? 2: Describe radioactive decay processes and the half-life? 3: Identify and describe fault and fold types? 4: Explain 3 of the 7...
-
The city manager of a large midwestern city was negotiating with the three unions that represented the police, firefighters, and building inspectors over the salaries for these groups of employees....
-
Minimizing file sizes for media and resources used on a Website is important to the end user experience. Question 5 5 options: True False
-
Explain various mapping procedures of cache memory with an example.?
-
Liquid bromine is a dark maroon/brown color. 1,2-dibromo alkanes, on the other hand, are colorless. What would it mean and why, if you added liquid bromine to your final transfer hydrogenation...
-
What is cache memory? How is it different from virtual memory?
-
Hi, Please create a detailed flowchart optimal PMUS placement considering the network reconfiguration (placement of sectionalizing switches and tie switches) using Binary Particle Swarm Optimization...
-
Income Statement As of December 31, Year 2 ($000s) Year 2 Sales 194,299 COGS 103,205 SG&A 54,329 EBIT Interest expense Other income (expenses). net Income before income taxes 36,765 612 966 37,119...
-
Which of these equations describes aerobic cellular respiration? Select one: A. glucose + oxygen carbon dioxide + water + energy B. energy + carbon dioxide + water C. glucose lactic acid + energy D....
-
Willingness to pay as a measure of a person's value for a particular good measures the maximum a person would be willing to pay requires that payment actually be made depends on the satisfaction that...
-
Flipside Ltd manufactures a single-size lubrication unit for use in wind turbines etc. It operates a standard absorption costing system and uses variance analysis to control its operations. The...
-
WSM Enterprises introduced the Wizkid in 1991 to compete with Action Man. Although the peak demand for these products occurred several years ago, sales have stabilized and WSM sells 15,000 Wizkids a...
-
Medley Ltd makes dishwashers. There are three production departments: machining, assembly and finishing; and two service departments: maintenance and stores. Costs are as follows: Production...
-
A4-stroke, 4-cylinder, single acting spark ignition petrol engine develops \(20 \mathrm{~kW}\) brake power at \(3000 \mathrm{rpm}\). The following data are given : Bore \(=65 \mathrm{~mm}\), Stroke...
-
A six cylinder four stroke I.C. Engine is to develop \(100 \mathrm{~kW}\) i.p. at 800 RPM. The stroke to bare ratio is 1.25. Assuming Mechanical efficiency of \(80 \%\) and break mean effective...
-
The following data is available for a four stroke petrol engine stroke volume \(=6\) Litres. Mean effective pressure \(=6\) bar. Speed of engine \(=750\) RPM. Calculate i.p. of the engine.
Study smarter with the SolutionInn App