answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
STALIN [3.7K]
1 year ago
14

In this question, you will experimentally verify the sensitivity of using a precise Pi to the accuracy of computing area. You ne

ed to perform the following activities with Python program:
a. Compute the area of a circle with radius 10 using Pi from the Python Math Module. Assign the area to a variable, say realA.
b. 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.

Computers and Technology
1 answer:
zhannawk [14.2K]1 year ago
4 0

Answer:

Follows are the code to this question:

import math as x #import math package

#option a

radius = 10#defining radius variable  

print("radius = ", radius)#print radius value

realA = x.pi * radius * radius#calculate the area in realA variable

print("\nrealA = ", realA)#print realA value

#option b

a1 = 3.1  * radius * radius#calculate first area in a1 variable  

print("Area 1= ", a1)#print Area

print("Percentage difference= ", ((realA - a1)/realA) * 100) #print difference  

a2 = 3.14  * radius * radius#calculate first area in a2 variable                            

print("Area 2= ", a2)#print Area

print("Percentage difference= ", ((realA - a2)/realA) * 100)#print difference  

a3 = 3.141  * radius * radius#calculate first area in a2 variable                       print("Area 3= ", a3)#print Area

print("Percentage difference= ", ((realA - a3)/realA) * 100) #print difference  

Output:

please find the attached file.

Explanation:

In the given Python code, firstly we import the math package after importing the package a "radius" variable is defined, that holds a value 10, in the next step, a "realA" variable is defined that calculate the area value.

In the next step, the "a1, a2, and a3" variable is used, which holds three values, that is "3.1, 3.14, and 3.141", and use the print method to print its percentage difference value.  

You might be interested in
4.17 LAB: Data File A comma separated value (.csv) file has been included to be used for this program. Each line contains two va
Andrej [43]

Answer:

import csv

def Csvreader(filename):

   with open("filename", "r") as file:

   content = file.csv_reader()

   list_content = list(content)

   file.close

   return list_content

Explanation:

This is a python description of the function that reads the csv file and converts it to a list, from the list, each item can accessed with its index and updated directly. Use this to draw the same conclusion for a java program.

7 0
1 year ago
WILL MARK BRAINLIEST HELP
hichkok12 [17]

My guess would be A.

3 0
1 year ago
Read 2 more answers
Explain why each of the following names does or does not seem like a good variable name to represent a state sales tax rate.
tatyana61 [14]

a. stateTaxRate  - A good variable name because it represents what it holds, the state sales tax rate, without being too wordy. Also correctly capitalized in camelcase.

b. txRt  - A bad variable name because while short and simple, it is too hard to understand what the variable represents.

c. t  - A very bad variable name if you plan on using the variable often. Far too short and you will forget what it represents and is needed for.

d. stateSalesTaxRateValue  - A bad variable name because it is just too wordy. Cutting it down to A's variable name is much more reasonable

e. state tax rate  - A bad variable name and probably invalid because it has spaces in the name.

f. taxRate  - A good variable name if there are no other tax calculations other than state tax rate. Otherwise you would confuse state vs local tax rate or something, making it a bad variable name.

g. 1TaxRate  - A bad variable name because the number 1 has no reason being in the variable name. It doesn't add anything to the name.

h. moneyCharged - A bad variable name because it is not specific enough in explaining why the money is being charged and what for.

7 0
2 years ago
An online article in 2001 described a study in which twelve sixth-grade students who had not previously played chess participate
ipn [44]
Bdbxhdhdhdbxbdhdhxhxhdhdhdhdhdhdhdhdhdbdhdhdhdhdhdhrhrhrhrhrhdhdhdhdisisieiejjdidieieieieieiei
6 0
1 year ago
Which of the following is a benefit, as well as a risk, associated with client/server networks?
KATRIN_1 [288]
C would be the correct answer to this question
6 0
2 years ago
Other questions:
  • Of the following tasks, which one CANNOT be easily accomplished with a Wiki? Collaborating Social networking Editing Reading
    13·1 answer
  • Any software or program that comes in many forms and is designed to disrupt the normal operation of a computer by allowing an un
    13·1 answer
  • Write a copy constructor for carcounter that assigns origcarcounter.carcount to the constructed object's carcount. sample output
    15·2 answers
  • Which selections are possible for controlling the start time of audio playback? Check all that apply. Automatic Rewind when done
    10·1 answer
  • Propane also known as LP gas, is often mixed with about _______ percent of other gases, such as butane, propylene, and mercaptan
    13·1 answer
  • Does the Boolean expression count > 0 and total / count > 0 contain a potential error? If so, what is it?
    8·1 answer
  • Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a n
    7·2 answers
  • Probability of theft in an area is 0.03 with expected loss of 20% or 30% of things with probabilities 0.55 and 0.45. Insurance p
    5·1 answer
  • A _______ bulb contains a high-pressure gas. Oils from the hands can affect the expansion of the glass, which can shorten the li
    13·1 answer
  • A mobile device user has tried to install a new app numerous times without success. She has closed all unused apps, disabled liv
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!