subject

Write a python function to determine the volume of material remaining after the hole is drilled. the function should take as input 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.)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
Consider the following statements: #include #include class temporary { private: string description; double first; double second; public: temporary(string = "", double = 0.0, double = 0.0); void set(string, double, double); double manipulate(); void get(string& , double& , double& ); void setdescription(string); void setfirst(double); void setsecond(double); }; write the definition of the member function set() so that the instance variables are set according to the parameters. write the definition of the constructor so that it initializes the instance variables using the function set() write the definition of the member function manipulate() that returns a decimal number (double) as follows: if the value of description is "rectangle", it returns first * second if the value of description is "circle" it returns the area of a circle with radius first if the value of description is "cylinder" it returns the volume of a cylinder with radius first and height second. hint: the volume of a cylinder is simply the area of the circle at the base times the height. if the value of description is "sphere" it returns the volume of the sphere with radius first. otherwise it returns -1.0;
Answers: 1
question
Computers and Technology, 22.06.2019 13:00
We as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in a computer’s language, however, it is preferred to have the operators on the right side of the operands, i.e. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix.write a program that takes an “infix” expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % (example infix expression: (7 - 3) / (2 + 2)postfix expression: 7 3 - 2 2 + /result: 1guidelines: 1. you will need to use stacks in three placesa. one for the parenthesis check [char stack]b. one during infix to postfix [char stack]c. one during evaluation [int stack]for a and b above, you can use same array and same push, pop method as both ofthem are char. but for evaluation you have int stack and you might consider to createanother push pop method to handle it. maybe push_int, pop_int, etc. or find otherstrategy to utilize existing push pop method2. you can create a function for obtaining operator priority. that function should take anoperator as input and return its priority as an integer. this function will you a lot andreduce repeated code3. during evaluation you will need to convert char into integer. example for single digit: char c = '5'; int x = c - '0';
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
In cell b18, enter a formula to calculate the amount budgeted for meals. this amount is based on the daily meal allowance and the total travel days (# of nights+1).
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Now you’re on your own. include a short summary of this section with plots in your lab report. write a matlab script file to do steps (a) through (d) below. include a listing of the script file with your report. 1 the soundsc(xx,fs) function requires two arguments: the first one (xx) contains the vector of data to be played, the second argument (fs) is the sampling rate for playing the samples. in addition, soundsc(xx,fs) does automatic scaling and then calls sound(xx,fs) to actually play the signal. mcclellan, schafer, and yoder, dsp first, 2e, isbn 0-13-065562-7. prentice hall, upper saddle river, nj 07458. c 2015 pearson education, inc. 4 mcclellan, schafer and yoder, signal processing first. prentice hall, upper saddle river, new jersey, 2003. c 2003 prentice hall. (a) generate a time vector (tt) to cover a range of t that will exhibit approximately two cycles of the 4000 hz sinusoids defined in the next part, part (b). use a definition for tt similar to part 2.2(d). if we use t to denote the period of the sinusoids, define the starting time of the vector tt to be equal to t , and the ending time as ct . then the two cycles will include t d 0. finally, make sure that you have at least 25 samples per period of the sinusoidal wave. in other words, when you use the colon operator to define the time vector, make the increment small enough to generate 25 samples per period. (b) generate two 4000 hz sinusoids with arbitrary amplitude and time-shift. x1.t / d a1 cos.2
Answers: 1
You know the right answer?
Write a python function to determine the volume of material remaining after the hole is drilled. the...
Questions
question
English, 18.11.2020 17:30
question
Mathematics, 18.11.2020 17:30
Questions on the website: 13722359