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
Snap Me on <br>samxavier.18​
Ahat [919]

Answer:no thank you ima goody

Explanation:

7 0
3 years ago
Read 2 more answers
Write on the importance of Computer application to statistics​
tatyana61 [14]

Answer:

Another way to categorise the relation statistics-computer is to list the different ways the computer can be used in statistics. The following are examples of such uses: numerical and graphical data analy- sis; symbolic computations; simulations; storing statistical knowledge; presentation of results.

Explanation:

5 0
3 years ago
The exception of MS Access 2007 and above files is _ and older version are _ files ​
ohaa [14]

Answer:

Never heard of that kind of software, but I think it's an old file.

4 0
3 years ago
How do you get past a firewall ?
DaniilM [7]
Use a Web-based Proxy. ...
Use a VPN. ...
Use Remote Access to Your Own PC. ...
Kill the Blocking Service. ...
Use Mobile Data as a Stopgap. ...
What if You're Using a Phone? ...
Sneaky Like a Boss.
3 0
3 years ago
When does personal information often need to be entered online?
soldi70 [24.7K]

Answer:

Like when your doing an application for a job or anything important lol

Explanation:

3 0
3 years ago
Other questions:
  • While working on a forty-slide PowerPoint presentation, a user needs to quickly look over the six slides that have orange backgr
    10·1 answer
  • How does theatre compare with movies or television? What makes it similar to movies and television? What makes it different?
    13·1 answer
  • What daily life problems does the algorithm quicksort solve?
    14·1 answer
  • In cell R9, enter a formula using the AVERAGEIF function to determine the average number of years of experience for lifeguards.
    12·1 answer
  • Narrowband Satellite Communications supports ______________ data rates for both mobile and fixed users by providing access on a
    8·1 answer
  • Write a program which capitalize every character after full stopin a given sentence
    11·1 answer
  • What are the two types of lighting?
    7·2 answers
  • Credible sites contain __________ information,
    7·2 answers
  • What is the mest gun in pixel gun 3d imma give you brainliest
    14·2 answers
  • using a timer to generate a random number, develop a program that displays random numbers between 1 and 47 (or whatever) for you
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!