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
An administrator is writing into a database and received an error detailed in the exhibit. What two steps need to be taken to re
d1i1m1o1n [39]

An administrator is writing into a database and received an error detailed in the exhibit. The two steps to be taken to resolve this are :

Move the Execute SQL statement to be between Connect and Disconnect. Move the Prompt Message to be before the Disconnect statements.

Explanation:

  • Dynamic SQL refers to SQL statements that are generated at run-time.
  • To disconnect from a database, in the Database Navigator or Projects view, click the connection and then click the Disconnect button in the toolbar or click Database -> Disconnect on the main menu
  • You can also right-click the connection and click Disconnect on the context menu
  • The PROMPT command may be used to display messages to the user, perhaps supplying a short summary of what your script is going to accomplish.
  • The SQL EXECUTE command executes an SQL command and binds the result to 4D objects (arrays, variables or fields).
  • A valid connection must be specified in the current process in order to execute this command. The sqlStatement parameter contains the SQL command to execute.

7 0
3 years ago
In the event of a network attack or intrusion, a _____ lists the tasks that must be performed by the organization to restore dam
dexar [7]

Answer:

The answer is "Recovery Plan for Disasters".

Explanation:

In the given statement, some of the information is missing, which can be described as follows:

A) systems engineering plan

B) security compliance plan

C) risk assessment plan

D) Recovery Plan for Disasters

It is a set of guidelines for the execution of a recovery process, it provides the restoration and safety to the system for the organization in the event of a disaster. It defined as "a detailed summary of the appropriate acts to be carried out before, during and after a disaster", and incorrect choices were explained as follows:

  • In option A, It is used to design and analyze complex systems.
  • In option B, It provides frameworks for the corporate evaluation process.
  • In option C, It is used to identify the problems.
6 0
3 years ago
Disk ________ realigns separated data so that related file pieces are unified.
PilotLPTM [1.2K]
Disk defragmentation realigns separated data so that related file pieces are unified. <span> Defragmentation is is the process of consolidating fragmented files on the user's hard drive.</span>This Microsoft Windows utility includes <span>rearranging the fragments and restoring them into fewer fragments or into the whole file.
</span>
4 0
2 years ago
If you see a diamond-shaped sign, it will be what type of sign?
Setler [38]
They are warning signs .
8 0
3 years ago
Read 2 more answers
How to recover permanently deleted photos on iphone 11?
grandymaker [24]

Answer:

Look in your recently deleted album and if it is not there try checking your iCloud, if its not there then it's sadly probably gone forever.

Explanation:

7 0
2 years ago
Other questions:
  • toThePowerOf is a method that accepts two int arguments and returns the value of the first parameter raised to the power of the
    6·1 answer
  • What is the purpose of a title slide on power point
    14·2 answers
  • What kind of video are you are able to watch by downloading it from the Internet?
    10·1 answer
  • Once Google Analytics processes data, it’s stored in a database where it can’t be modified.
    9·1 answer
  • Which form of investigation aims at checking whether or not a target system is subject to attack based on a database of tests, s
    15·1 answer
  • Which type of NAC agent will be used during the posture assessment before allowing access to the VPN users?
    9·1 answer
  • Which attribute defines the file name for the specific image in an image tag??
    13·1 answer
  • True or false when a host gets an IP address from a DHCP server it is said to be configured manually
    15·1 answer
  • Many companies use telephone numbers like 555-GET-Food so the number is easier for their customers to remember. On a standard te
    6·2 answers
  • Any changes done to the software during the operational phase of the software before project wind up is called as maintenance. S
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!