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]
2 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]2 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
Gold is not more useful than iron. (Rewrite in positive form by replacing the comparative adjective)​
Sonja [21]

Answer:

Gold is more useful than iron

5 0
3 years ago
When did the silent movie era end?<br> A.1919<br> B.1929<br> C.1939<br> D.1949
11111nata11111 [884]

Answer:

The answer is 1929.

5 0
3 years ago
Read 2 more answers
Which JavaScript defense restricts a JavaScript downloaded from Site A from accessing data that came from Site B?
suter [353]

Java script same origin defense restricts a JavaScript downloaded from Site A from accessing data that came from Site B.

<h3>Defenses and Browser Vulnerabilities</h3>

Java script sandboxing defense JavaScript to run in a restricted environment ("sandbox") and limit the computer resources it can access or actions it can take.

Java script same origin defense restricts a JavaScript downloaded from Site A from accessing data that came from Site B.

Java script limit capabilities restrict JavaScript to not support certain capabilities.

Find out more on browser vulnerability at: brainly.com/question/18088367

5 0
2 years ago
Define a class named person that contains two instance variables of type string that stores the first name and last name of a pe
Katarina [22]

Answer:

Answered below

Explanation:

//Program is written using Java programming language.

Class Person {

private string firstName;

private string lastName;

void set firstName(string a){

firstName = a;

}

string getFirstName(){

return firstName;

}

void setLastname( string b){

lastName = b;

}

string getLastName( ){

return lastName;

}

void displayDetails( ) {

System.out.print(firstName);

System.out.print (lastName);

}

}

//Test program

Class Main{

public static void main(String args [] ){

Person person = new Person( )

person.setFirstName("Karen")

System.out.print(person.getFirstName)

person.displayDetails()

}

}

5 0
2 years ago
File explorer provides ____ ways to view the contents of a folder.
AURORKA [14]
2 or 3 ways.......................................
5 0
3 years ago
Other questions:
  • How is a network address of 192.168.6.0 and a subnet mask of 255.255.254.0 written in cidr?
    12·1 answer
  • ____ is a practice where a user in enticed by possible rewards and then asked to provide personal information.
    14·1 answer
  • If Tracy starts on the left edge of the canvas and moves forward 50 pixels, how many times will this code need to be repeated to
    5·1 answer
  • ___________________ are aggregated collections of memory and cpu resources that can be shared among groups of virtual machines o
    11·1 answer
  • . Each ____ on a menu performs a specific action.
    14·1 answer
  • What is the full path and filename for the file on a Debian Linux distribution that displays the time zone settings?
    13·1 answer
  • Drag each tile to the correct box.
    9·2 answers
  • ANSWER ASAP!!! 12 POINTS!!!!! RIGHT ANSWERS ONLY
    7·2 answers
  • SHA-1 produces a(n) ___________-bit message digest, which can then be used as an input to a digital signature algorithm.
    5·1 answer
  • 4. Ernesto works in a small office with five other people. What are two possible connection
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!