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
Assume that sentence is a variable that has been associated with a string consisting of words separated by single space characte
sleet_krkn [62]

The right code is,

secondWord = sentence.substr (sentence.find ("`") + 1);

secondWord = secondWord.substr (0, secondWord.find ("`"));

3 0
3 years ago
Read 2 more answers
o maintain reasonable key security (mark all that apply): Ensure that someone else always has an extra key. Ensure that no extra
Komok [63]

Answer:

The answer is "second, third, and fourth choices"

Explanation:

In the question the numbering of the choices were missing if we numbering the choices so, the first choice will be one first number and second choice is in second and so on, and its explanation can be defined as follows:

The network safety key is a type of network login credentials or passwords which is used for provides authorization as well as access the network or device upon which client requests to communicate throughout the form of physical, digital, or biometrical information login.  

  • It doesn't ensure the extra key.  
  • It helps ensure there were no additional duplicates.  
  • It keeps strict access codes as well as keys command.  
  • It makes sure, that its key could not be linked to able to operate the lock.
6 0
2 years ago
I need help with humans need not apply for codeing
vampirchik [111]

Answer:

huge\color{blue}\boxed{The}\huge\color{pink}\boxed{Points

3 0
2 years ago
Read 2 more answers
Um?<br><br> i went to check my questions and i found this-
asambeis [7]

Answer:

just go ahead and refresh the page

Explanation:

5 0
2 years ago
Two different applications that make use of the barcode
jeyben [28]
Library books and items bought in stores are 2 different applications that make use of barcodes.
8 0
3 years ago
Other questions:
  • When pasting an object which has been copied from a different slide, where on the slide does the object paste, assuming nothing
    15·1 answer
  • What is master slide and tell about master slide
    6·1 answer
  • program students can get credit for their high school classes as long as they take a specific courses that a college will accept
    13·2 answers
  • What does that program print out?<br><br> a) 2<br> b) 3<br> c) 4<br> d) 8
    14·2 answers
  • Enter the answer.
    11·2 answers
  • What is the multiple source test
    15·1 answer
  • Discuss how the accessibility of television has changed over time
    7·1 answer
  • As a general rule, the number of bullet points on a slide should not exceed _____. a.2 b.4 c.8 d.10
    9·1 answer
  • Consider the following statement: String myMiddleInitial = “h”;
    15·1 answer
  • Write a Python program that uses three variables. The variables in your program
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!