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
a. displays the sum of all even numbers between 2 and 100 (inclusive). b. displays the sum of all squares between 1 and 100 (inc
LuckyWell [14K]

Answer:

The program required is in the explanation segment.

Explanation:

Program :

import math

# a. displays the sum of all even numbers between 2 and 100 (inclusive).

print("All even numbers from 2 to 100 inclusive ")

sum=0

i=2

while i<=100:

if i %2 ==0:

sum=sum+i

print(i,end=" ")

i=i+1

print("\nThe sum of all even numbers between 2 and 100 (inclusive) :",sum);

#b. displays the sum of all squares between 1 and 100 (inclusive).

print("\nAll squares numbers from 1 to 100 inclusive:")

i=1

sum=0

while i<=100:

print(i*i,end=" ")

i=i+1

sum=sum+(i*i)

print("\n\nThe sum of all squares between 1 and 100 (inclusive) is :",sum)

#c. displays the powers of 2 from 1 up to 256.

print("\nAll powers of 2 from 2 ** 0 to 2 ** 8:")

i=0

while True:

p=math.pow(2,i)

if p>256:

break

print("2 ** ",i," is ",int(p))

i=i+1

#d. displays the sum of all odd numbers between a and b (inclusive), where a and b are inputs

print("\nCompute the sum of all odd integers between two intgers ")

a=int(input("Enter an integer:"))

b=int(input("Enter another integer: "))

count = 0

temp=a

sum=0

while a<=b:

if a%2!=0:

print(a,end=" ")

sum=sum+a

a=a+1

print("\nThe total of the odd numbers from ", temp ," to ", b ,"is",sum)

#e.displays the sum of all odd digits of an input. (For example, if the input is 32677, the sum would be 3 + 7 + 7 = 17.)

print("\nCompute the sum of the odd digits in an integer ")

n=int(input("Enter an integer:"))

count=0

sum=0

temp=n

while n!=0:

rem = n%10

if rem%2!=0:

sum=sum+rem

count=count+1

n=int(n/10)

print("Sum of the odd digits is ",sum)

print("The total of the odd digits in ",temp," is ",count)

4 0
3 years ago
Which of the following is not a basic role of a webmaster
Natalija [7]
Out of the following, the only one that I see is not the basic role of a webmaster is replying to customers questions about the web site! Usually they have a specific job for that; like customer service etc. Hopefully that helps.
5 0
3 years ago
Hi can someone help me make a like a song for music Class pls I attached an example of what i need.
g100num [7]

Answer:

i dont really like music so sorry i cant help i hope someone can help you with this.

8 0
3 years ago
When excel follows the order of operations the formula 8 * 3 + 2 equals?
Airida [17]
It follows the normal convention of BODMAS , which is the order of precedence of operations , so the answer equals to 26
3 0
3 years ago
If you store a binary tree in an array the index of the right child and the left child is computed by _______
Fiesta28 [93]

Answer:

left child = 2 index +1 & right child = 2 index + 2

Please Mark Brainliest If This Helped!

3 0
2 years ago
Other questions:
  • Software license infringement is also often called software __________.
    11·2 answers
  • When a formula contains the address of a cell, it is called a(n)
    9·1 answer
  • What is encyclopedia. Com considered to be?
    14·1 answer
  • How can you efficiently restrict the read-only function of a requesting SNMP management station based on the IP address?
    14·1 answer
  • "Create a Matlab Scrapt that will take the a Matrix A and Matrix B (of AX=B), then calculate the Determinant of Matrix A, Invers
    5·1 answer
  • In 2011 a program named Watson running on an IBM supercomputer
    12·1 answer
  • Write an application that allows a user to enter any number of student quiz scores, as integers, until the user enters 99. If th
    5·1 answer
  • Which function calls would provide the most helpful test of this function? Remember: With tests, you are attempting to figure ou
    5·1 answer
  • Can geico save me 15% or more on car insurance?
    8·2 answers
  • 5. What skill is unique to reading online?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!