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
Which statement is true about a metamorphic rock that was exposed to stress equally from all directions?
Zolol [24]
I think the correct answer from the choices listed above is option B. A  metamorphic rock that was exposed to stress equally from all directions <span>will have all of its mineral crystals aligned in layers. Hope this answers the question. Have a nice day.
</span>
7 0
3 years ago
Which system procedure is normally done with both hand valves opened on a gauge manifold connected to a refrigeration system?
mars1129 [50]

Answer:

The answer is "Evacuation".

Explanation:

The evacuation in coolants was its removal from the coolant of heat, air, and non-condensable toxic gases. Its seal HVAC system is drawn to a vacuum and use a pressure washer throughout this process.  

  • It loses the air and water vapor throughout the coolant point is called it.
  • The two primary goals are accomplished by evacuating, that are eliminates content and hydrates.
8 0
3 years ago
PLSSSSSS HELP ASAP<br><br> What story does the game Senet tell?
kkurt [141]

Answer:

In the New Kingdom, the game senet, which means "passing," became associated with the journey to the afterlife. Some of the squares of the game corresponded to the hazards a person might meet on their journey to the afterlife, while other squares helped the players.

Explanation:

8 0
3 years ago
Read 2 more answers
The Review feature automatically adjusts to select the edited information.<br> true of false
NNADVOKAT [17]
True I hope this helps
8 0
3 years ago
Read 2 more answers
When does patch 1.6 come out for the division?
Fynjy0 [20]
Thurdsay the 9th of february 
5 0
3 years ago
Other questions:
  • Which of the operating systems listed below is not proprietary?
    8·1 answer
  • The term “computer literacy” dates back to what decade? <br> 1960s<br> 1970s<br> 1980s<br> 1990s
    5·1 answer
  • What piece of software tells the operating system how to use a specific hardware device? a. User interface b. System service c.
    14·1 answer
  • Which note taking strategy has you divide a page into 3 sections for your notes, key points, and summary?
    11·1 answer
  • Intellectual property rights are exclusive rights that help protect both the created and the creation. IPR offers exclusively wh
    8·2 answers
  • Which of the two do you think is the most secure mode of communicating: sending a letter using the postal service or sending an
    9·1 answer
  • Java Eclipse homework. I need help coding this
    6·1 answer
  • What types of standards are developed by the Electronics Industries Alliance (EIA)?
    14·2 answers
  • Trebuie sa scrii niște instrucțiuni în JavaScript care adaugă în DIV lungimea HTML-ului din interiorul tag-ului cu ID​
    14·1 answer
  • The success of Eye of the storm exemplifies
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!