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
In 1964 in London, Ontario one could buy a chili-dog and a root beer for $1.25, today the same chili dog and root beer cost $5.0
Marta_Voda [28]

Answer:

3% inflation rise. No correct cpi option

Explanation:

Consumer Price Index(CPI) is calculated by the Bureau of Economic Analysis and Statistics of a country monthly and annually.

Consumer Price Index(CPI) is used for measuring the changes in the price level of consumer goods and services purchased by households.

Calculating the consumer price index; price in 1964= $1.25, today price= $5.0.

Therefore, consumer price index= Price in today- price in 1964÷ price in 1964,.

Consumer Price index(CPI)= $(5-1.25)/1.25 = 3.75/1.25 = 3 Percent price inflation rise.

For the first cpi; 112-80/80= 0.4 percent( not equal to the 3 Percent inflation rise).

For the second cpi: 141.6-60/60= 1.36 Percent inflation rise(not equal to the 3 Percent inflation rise).

For the third CPI: 126.4-75/75 =0.68 percent inflation rise[not equal to the 3 Percent inflation rise].

For the third CPI: 108.5-90/90=0.21 percent inflation rise(not equal to 3 Percent inflation rise)

Therefore, none of the options are right.

5 0
3 years ago
Accepted identifier for a variable in PHP except:
Svetradugi [14.3K]

Answer:

b. & Puihaha

Explanation:

PHP variables are supposed to start with a $ sign.

Other rules followed by PHP variables are:

Starting character in variable name (after $) must be letter or _.

Other characters in variable names can be letters,numbers or _.

a. $_Puihaha

c. $Pui_haha

d. $Puihaha

satisfy these rules.

Whereas , b. & Puihaha does not satisfy as it starts with '&'. Moreover it also contains an invalid space character in the variable.

7 0
2 years ago
What is the basic facilities, services, and installations needed to keep a
lara31 [8.8K]

Answer:

transportation and communications systems, water and power lines, and public institutions like schools, post offices, and prisons.

Explanation:

7 0
2 years ago
Which Display Ad format should you use if you're concerned about malware and want a secure ad experience across platforms?
Dennis_Churaev [7]

Answer:

"AMPHTML ads" is the correct answer for the above question.

Explanation:

  • The "AMPHTML" is used for secure ads, which is written in the form of AMP HTML.
  • It is a lighter and faster ad that has the features of doing the ads securely.
  • It is safe from the virus because it is verified by the software while transferring on the internet.
  • The above question asked about the display which can be used for secure ads. Then the ads are an "AMPHTML" which is described above.
3 0
3 years ago
Now plz<br>draw the main memory​
Sophie [7]

Answer: Here is my answer- I hope it helps! Btw I did search this up but I change some words so I don't get in trouble again ; - ;

Explanation: A unit of measurement is a definite importance of an amount, defined and adopted by convention or by law, that is used as a standard for measurement of the same kind of amount. Any other amount of that kind can be expressed as a multiple of the unit of measurement. For example, a length is a physical amount.

3 0
2 years ago
Other questions:
  • Your computer running Windows 7 is doing some very strange things with the operating system. You are fairly certain it is not a
    10·1 answer
  • How would you print from 1 to 1000
    13·1 answer
  • Univariate linear regression Note: Solutions to this problem must follow the method described in class and the linear regression
    7·1 answer
  • According to the author, there are five hedging strategies organizations can pursue. One of them is: Select one: a. commit with
    5·1 answer
  • Which camera mode gives the photographer the greatest amount of control?
    7·2 answers
  • What feature is not included in most DTP programs?
    9·1 answer
  • The show ip dhcp binding command displays _____. (Points : 5) the MAC table cache information
    7·1 answer
  • 11) A single inheritance model means: * A) A class can only have one parent class (superclass) B) A class can only have one chil
    7·1 answer
  • __________ is a Microsoft software development tool that developers can use to write multimedia applications
    13·1 answer
  • Which of the following is NOT a long-term storage device?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!