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
Wendy Patel is entering college and plans to take the necessary classes to obtain a degree in architecture. Research the program
jeka57 [31]

Answer:

Follows are the solution to this question:

Explanation:

If Windy needs to study and be a specialist in graphic designing for machines, I'm going to provide a windy link of the machine with such a 64 bit, 3-GHz Intel or AMD processor with an 8 GB  RAM, an OpenGL 4.1 chip, an inter-button cursor, a right thumbstick, or a storage drive with GB at least.  

  • All above description for the computer is suitable for windy because you would well be aware throughout the graphic designing, that may be learned through iRhino 3D (iOS), Autocad, Magical Plan, Morphoio trace, etc if you'd like to graduation in architecture.
  • They require fast internet for each application, that can also be installed and installed, that  often requires a profile of all technical support programs as well as a web-only storage license.  
  • As many of the above applies also runs through an AMD or six-bit intel, but not on the ARM processor or instance  iRhino 3D (iOS) isn't consistent with an Embedded system, I will select the processor like an Intel or 3GHz AMD processor.
4 0
3 years ago
How does one build social capital?
iren2701 [21]

Answer:

by building on line presence

Explanation:

If you put yourself out there in multiple social sites you will build a following

3 0
3 years ago
Im lonellly whos down to date me
inna [77]

Answer:

I was actually just looking to help with someone's schoolwork. . .

Explanation:

5 0
3 years ago
Read 2 more answers
Please complete the following questions. It is important that you use complete sentences and present the questions and answers w
Vanyuwa [196]

Answer:

well... i came for the same answer

Explanation:

7 0
3 years ago
Read 2 more answers
❤️❤️❤️❤️❤️❤️❤️❤️IS THERE ANYONE'S STILL AWAKE?? HMM HEHE I'M HERE AGAIN~~~ FOLLOW ME FOR MOR3~~​
insens350 [35]

Answer:

hello?

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • When should students practice netiquette in an online course? Check all that apply.
    14·2 answers
  • How are the internet and the World Wide Web different from each other
    14·1 answer
  • You have found an old dusty computer in your basement that you can identify as an original IBM PC. You ask your friend if he kno
    13·1 answer
  • What was one of the first inventions that made it possible to communicate almost instantly?
    11·1 answer
  • What is structured​ knowledge?
    10·1 answer
  • What do you call the physical, touchable, materials parts of a computer system?
    7·1 answer
  • What is the name of the advanced warrior race of robots in Doctor Who?
    10·2 answers
  • Eliza needs to share contact information with another user, but she wants to include only certain information in the contact. Wh
    9·2 answers
  • ...................You like swamps
    13·2 answers
  • Rachelle is writing a program that needs to calculate the cube root of a number. She is not sure how to write the code for that
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!