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
The best way for employees to improve their skills online is to enroll in a digital
Maksim231197 [3]

The best way for employees to improve their skills online is to enroll in a digital office.

office.

<u>Explanation:</u>

In the present innovation-driven world, upskilling is turning out to be progressively significant just in light of the fact that innovation changes so quick.

A key preferred position for workers in web-based learning is that representatives can finish their preparation voluntarily and as indicated by their own timetables.

Enrolling in a digital office would allow an individual to learn at their ease, pace and comfort. It will definitely help the individual to expand and acquire skills.

So now full-time workers or the individuals who essentially don't have the opportunity to return to college full-time have a lot of chances to discover low maintenance courses.

6 0
3 years ago
Read 2 more answers
Do applications need to exchange udp control messages before exchanging data
Molodets [167]

The answer is NO.

Thats what makes UDP connectionless. Aclient that is going to send a UDP message to the server just sends it.The server does not know it is coming untill it arrives .When a server recieves a UDP message it gets the source address/port and the data.

7 0
3 years ago
Explain why a sound background in auto electricity and electronics is absolutely necessary if you are to troubleshoot
Fynjy0 [20]

the electrical system important for starting up your vehicle, but it is also important for keeping your vehicle running as you drive it. In addition, it is the electrical system that is also responsible for the functioning of things such as your headlights, your radio, and your dashboard

4 0
2 years ago
How come the scroll bar on the PA emojis only appears sometimes? how do I make it appear?
astraxan [27]
Answer it your own self everybody can't always give u the answers
5 0
3 years ago
When evaluating a website's content, whether or not the information is up to date is considered part of the ________ element.
nirvana33 [79]

The currency element constitutes information whether the information of the website is current or up to date.

<h3>Website</h3>

A website is a term used to describe unique publicly accessible web pages that are identified by a domain name. Information on websites is typically updated by website owners, hence, some websites may not be updated frequently when compared to others. Thus, the currency element is an element users take into consideration when evaluating a website's content, whether or not the information is up to date.

You can learn more about the currency element here https://brainly.in/question/48673521

#SPJ1

3 0
2 years ago
Other questions:
  • Which of these graphic elements combine text, illustrations, and color?
    14·2 answers
  • What does subscribing to a website’s RSS feed provide to a subscriber?
    10·1 answer
  • Can you hook up an ethernet cable to a phone jack
    5·1 answer
  • In JAVA please:
    15·1 answer
  • The method main of a class is called when you instantiate an object of that class like this: Box myBox = new Box();
    9·1 answer
  • The game begins with the player having 20 POINTS
    11·1 answer
  • The merge sort algorithm sorts using what technique?
    8·1 answer
  • This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balance
    5·1 answer
  • We already know that we can create a lunar lander application of the pipe-and-filter architecture style from three independent J
    6·1 answer
  • In the space provided, analyze the pros and cons of becoming a member of an artistic guild. Your answer should be at least 150 w
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!