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
Andru [333]
3 years ago
11

Write a function ""volCylinder"" that takes twofloats""r""for the radius and ""h""for the height of the cylinder and returnsthe

volumeof the cylinder. You can check the Wikipedia page to learn about volume calculation of the cylinders:
Computers and Technology
2 answers:
shutvik [7]3 years ago
8 0

Answer:

   public static double volCylinder(double r, double h){

       double volCylinder = Math.PI*(r*r)*h;

       return volCylinder;

   }

Explanation:

Using Java programming language

The function (method) is declared to accept two double parameters for radius and height

Using the formula Vol = \pi r^{2} h The volume is calculated and returned.

See a complete java code with a main method below

<em>public class num7 {</em>

<em>    public static double volCylinder(double r, double h){</em>

<em>        double volCylinder = Math.PI*(r*r)*h;</em>

<em>        return volCylinder;</em>

<em />

<em>    }</em>

<em>    public static void main(String[] args) {</em>

<em>    double radius =5.1;</em>

<em>    double height = 7.1;</em>

<em>        System.out.println("The volume of the cylinder is: "+volCylinder(radius,height));</em>

<em>    }</em>

<em>}</em>

Mandarinka [93]3 years ago
4 0

Answer:

def volCylinder(r, h):

   return 3.14 * r * r * h;    

radius = float(input("Enter the radius: "))

height = float(input("Enter the height: "))

print("The volume of the cylinder is: "+ str(volCylinder(radius, height)))

Explanation:

- Inside the function, calculate the volume of the cylinder using the formula and return the result.

- Then, take inputs from the user for radius and height as float numbers

- Call the function and print the result

You might be interested in
After you use the fill handle to copy cell contents, the quick copy options button appears, which can be used to fill the cells
Dimas [21]
After you use the fill handle to copy cell contents, the autofill options button appears, which can be used to fill the cells with only specific elements of the copied cell. The button <span>is a small square that appears in the bottom-right corner when you select a cell or range.</span>
7 0
3 years ago
Explain briely what this statement mean.<br>"A byte is equivalent to a character"<br>​
dedylja [7]

To put it briefly, a byte is equivalent to a <em>character</em> in that it encodes a single character, being this in the form of a<u> letter, number, or symbol.</u>

A byte is the smallest unit of storage memory on any modern computer. This byte is commonly made up of<u> eight bits</u>, a combination of binary digits used to represent data. The hierarchy of computer memory is as follows:

  • 1 byte
  • 1 kilobyte
  • 1 megabyte
  • 1 gigabyte
  • 1 terabyte

The statement "<em>A byte is equivalent to a character</em>" is quite literal in its meaning given that through the use of the bits that comprise it, a byte is used to represent and store the data for a single character of text, being that a <u>letter, number or at times a symbol.</u>

<u />

To learn more:

brainly.com/question/13188094?referrer=searchResults

3 0
3 years ago
It's best to use assertive speech when you<br> I want to show respect. *<br> True<br> False
mestny [16]

Answer:

True

Explanation:

Hope this helps :)

6 0
3 years ago
Read 2 more answers
How to create drop down list in excel with multiple selections.
Art [367]

Answer: <em>Select the cell or cells you want the drop-down list to appear in.</em>

<em>Click on the Data tab on Excel's ribbon.</em>

<em>Click on the Data Validation button in the Data Tools group.</em>

<em>In the Data Validation dialog, in the Allow: list select List.</em>

<em>Click in the Source: box.</em>

<em />

<em></em>

<em />

8 0
3 years ago
Read 2 more answers
What does coding mean​
NeTakaya
The process or activity of writing computer programs.
3 0
3 years ago
Read 2 more answers
Other questions:
  • 3.A customer has a system with a Gigabyte B450 Aorus Pro motherboard. He wants to upgrade the processor from the AMD Athlon X4 9
    11·1 answer
  • (a) Write a SCHEME function (make-change n den) which outputs a list of change specifications. Namely, a call (make-change 11 (l
    8·1 answer
  • What are programming paradigms?​
    9·1 answer
  • You rub two red balloons against a wool scarf. What do you think will happen if you place the balloons near each other. Justify
    5·1 answer
  • Checker for integer string (Please answer in C++):
    8·1 answer
  • Which was the first arcade game that was adapted for mobile phones ????
    13·1 answer
  • How do you reset a g.mail password?
    12·2 answers
  • What are some benefits that each computer system being used?
    12·2 answers
  • Which tags do you use to write the header and items of an ordered list on a web page?
    14·1 answer
  • Write a recursive function called DigitCount() that takes a positive integer as a parameter and returns the number of digits in
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!