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
bonufazy [111]
2 years ago
14

Write a program calculate the volume of a cylinder with a radius of 8 m. and 5m. high

Computers and Technology
1 answer:
Korolek [52]2 years ago
6 0

Answer in Python:

<em># Define program constants</em>

PI = 3.14

radius = 8

height = 5

<em># Welcome the user to our program</em>

print("### Calculating volume of Cylinder with Radius of 8m and Height of 5m...")

<em># Calculate the volume</em>

volume = PI * radius ** 2 * height

<em># Print the result</em>

print("The cylinder volume is:", volume, "m³")

References:

  • https://www.w3schools.com/python/python_variables.asp
  • https://www.w3schools.com/python/python_operators.asp
  • https://www.w3schools.com/python/ref_func_print.asp
You might be interested in
What component can be used for user input or display of output?
kogti [31]

Answer:

JTextField

Explanation:

JTextField is a Swing control which can be used for user input or display of output. It corresponds to a textfield and can be included with other controls such as JLabel, JButton,JList etc. on a comprehensive user interface which is application dependent. JTextField supports a read-write mode where the user can enter a value and it also supports a read-only mode which can be used to display non-editable output to the user.

4 0
3 years ago
I need help plzzzzzzz
Aleonysh [2.5K]

By looking at your code, it seems like you're trying to let the user enter positive numbers until the user enters a negative number. To achieve this, you need to indent int(input("Enter a number, negative to stop")) inside the loop.

The second answer choice is correct.

3 0
2 years ago
Explain how using assistive technology can promote healthy emotional and social development. Discuss how you think young childre
mina [271]
Assistive technology is commonly used by people with multiple disabilities. It helps them to live more comfortable and it makes their life much easier.
7 0
3 years ago
The divBySum method is intended to return the sum of all the elements in the int array parameter arr that are divisible by the i
iragen [17]

Answer:

The complete method is as follows:

public static int divBySum(int[] arr, int num){        

     int sum = 0;

     for(int i:arr){

         if(i%num == 0)

         sum+=i;

     }

     return sum;

   }

Explanation:

As instructed, the program assumes that arr has been declared and initialized. So, this solution only completes the divBySum method (the main method is not included)

This line defines the method

public static int divBySum(int[] arr, int num){        

This line declares and initializes sum to 0

     int sum = 0;

This uses for each to iterate through the array elements

     for(int i:arr){

This checks if an array element is divisible by num (the second parameter)

         if(i%num == 0)

If yes, sum is updated

         sum+=i;

     }

This returns the calculated sum

     return sum;

   }

8 0
3 years ago
Which of the following are examples of packages you can import and use classes from in java?
Svetlanka [38]
It’s D java. int i think
8 0
3 years ago
Other questions:
  • Which version of Windows was considered an operating environment rather than an operating system?
    14·1 answer
  • I want to know all the part of computer system
    14·1 answer
  • What is the order in which windows systems receiving and process multiple gpos?
    7·1 answer
  • To make a complicated task easier, use a _____.
    12·1 answer
  • (BRAINLIEST QUESTION) What are some challenges that will need to be overcome in order for the Internet of Vehicles to become a r
    13·1 answer
  • Which form of currency is not backed by gold today
    14·1 answer
  • All of the following are examples of being computer literate, EXCEPT ________. Group of answer choices knowing how to build and
    7·1 answer
  • Identify an advantage of the software as a service (SaaS) approach in public cloud computing. Group of answer choices The user h
    5·1 answer
  • Select the correct answer.
    13·2 answers
  • Describe how to add slide numbers and image to a Microsoft power point presentations ?​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!