1answer.
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
enyata [817]
3 years ago
8

Write a Python function to determine the volume of material remaining after the hole is drilled. The function should take as inp

ut parameters the length, width and height of the box and the radius of the hole. (You may assume that the measurements are all specified in the same length units.) The function should return the volume of material remaining. The function should check that the dimensions are consistent with reality. For example, the radius of the hole should be less than the minimum of (length/2) and (width/2). If the input data is not consistent, the function should return an appropriate value or otherwise indicate the problem. (It is your choice as to how to handle this. You may want to consider explaining your method for error handling in a docstring.)
Computers and Technology
1 answer:
Andru [333]3 years ago
5 0

Answer:

height = int(input ("Enter height : ") )

print (height)

width = int( input("Enter length : ") )

print (width)

half_width =width/2

half_height=height/2

while 0==0:

   radius = float( input("Enter radius : ") )

   print (radius)

   

   if radius<half_width and radius <half_height:

       break

def remainingVolume(height,width,radius):

       

   vol_box=height*width*width

   print (vol_box)

   vol_hole=3.14178*radius*radius*height

   print (vol_hole)

   

   remaining_vol=vol_box-vol_hole

   print ("Remaining volume is ",remaining_vol)

   

remainingVolume(height,width,radius);

Explanation:

Take input from user for height ,width and radius. To find volume of box formula is vol=height* width*length\\

Let's assume width and length is same so

length= width

Using this formula of box volume find box volume.Now find volume of hole.

Consider hole as small cylinder, find volume of cylinder and subtract from volume of box to get remaining volume of box after hole.

vol_of_cyl=\pi radius^{2} height

You might be interested in
Which of the following is NOT a way the media communicates unrealistic body images?
Leokris [45]

The media communicates unrealistic body image through various ways, which are mentioned in the available options for the question. It definitely digitally alters images that they use for their various publications, and it also provides forums to discuss actor and actresses, including their looks.

The media also often criticizes high-profile individual’s current body condition – whether they are too underweight or too overweight. Thus, the best answer for the question would be (D) promoting all body types.

6 0
3 years ago
Read 2 more answers
__________ is a network project that preceded the internet.
suter [353]
Arpanet. I think is the answer.
8 0
3 years ago
A doorknob is an example of which simple machine?
Zarrin [17]
A doorknob is an example of a:
D. Wheel and Axle. 
I hope this helped ^_^
3 0
3 years ago
Read 2 more answers
This question involves the app Messenger the blue thing that can be synced with Facebook. So my friend took a picture of my code
jarptica [38.1K]
He probably hasn't sent the request or you haven't updated it or he is not part of your Facebook  contac list
7 0
3 years ago
Please help me i will award brainliest
Sergio [31]

Answer: It would be option C.

Explanation: The file name is invalid, so therefore it would make sense to rename the most recent version correctly.

8 0
3 years ago
Other questions:
  • What is tuple and attribute of a relation​
    11·1 answer
  • You may see the term FAQ on websites which stands for Frequently Asked Questions this is an example of which type of mnemonic?
    9·1 answer
  • Design and implement a class called Sphere that contains instance data that represent the sphere’s diameter. Define the Sphere c
    6·1 answer
  • List 10 programs or applications on your computer other than any Microsoft office programs
    11·1 answer
  • Images from your .............. can be copied and pasted in a folder on your computer ​
    8·1 answer
  • What type of engineer is interested in designing, developing, and building different machines, devices, and tools? A.aerospace
    8·2 answers
  • Which logic gate produces an output of 1 only if both its inputs are 0
    12·2 answers
  • . What is the difference between a combinational circuit and sequential circuit? Give example of each.
    8·1 answer
  • Which of the following statement is correct ? A . potential difference is measured by ammeter . B . The unit of potential differ
    9·1 answer
  • Give 5 examples for software ​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!