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
Question # 6
nika2105 [10]

Answer:

14.0

Explanation:

The loop converts each answer to a float. The accumulator variable adds the values entered.  

2.0 + 5.0 + 1.0 + 6.0 = 14.0

3 0
3 years ago
Read 2 more answers
Find and fix the error in the if-else statement. import java.util.Scanner;
salantis [7]

Answer:

Hi there Rumanruxi! The error is in the if statement "if(userNum = 2)".

Explanation:

The if statement in this Java code is assigning userNum the value of 2 instead of comparing it with the value of 2. For equals comparison we need to write two equals "==" in the statement as: "if (userNum == 2)". This will return true if userNum is 2 otherwise it will return false.  

3 0
3 years ago
Read 2 more answers
Which of these completes the sentence? People interpret information ___________. Choose one.
evablogger [386]

Explanation:

mannejaondpsbma0jdjdhdj

5 0
3 years ago
Read 2 more answers
Describe how computer become <br> in the next 35 year
marin [14]
Well im going to say that it is going to be more advanced and easier to hack. Not only that but more and more people are going to be using it. You'll see ten year olds and five year olds using computers like they are professionals 
8 0
3 years ago
The initial step of the five-step problem-solving model is to: A. Explore alternatives B. Clarify values. C. Develop an approach
Alik [6]

Answer:

D. Identify the problem.

Explanation:

         

The five steps are -

  • Identify the problem
  • Understanding the problem
  • Select any alternative way to solve a problem
  • Select the best way to solve a problem from the list of alternative solutions.
  • List the instructions to solve the problem using the selected solution and evaluate the solution .

Identify the problem - This is the first steps towards solving a given problem. One must properly comprehend what exactly the challenge is.

8 0
3 years ago
Other questions:
  • 9. In Electronic Codebook (ECB): a. The message is broken into independent blocks which are encrypted b. The message is broken i
    6·1 answer
  • An administrator needs to set up an authentication server for users connecting to a network through a VPN. What kind of server c
    10·1 answer
  • You have a new phone. What determines what type of messages you can send?
    15·1 answer
  • With dhcp, a device borrows, or ____ an ip address while it is attached to the network.
    6·1 answer
  • Hunter took his sick puppy to Jade to get medication. Jade is
    14·2 answers
  • Computer Networks - Queues
    11·1 answer
  • Write bash script which takes array as an input of size 10 bind its even indexes to accept even values and odd indexes to accept
    5·1 answer
  • CAN SOMEONE PLEASE PLEASE HELP ME OUT !!!!
    12·1 answer
  • Name the major types of computer systems from slowest to fastest. ​
    9·1 answer
  • write a recursive bool valued function containsvowel that accepts a string and returns true if the string contains a vowel
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!