Write a program to calculate the volume and surface area of a sphere from it radius given as input. Here are some formulas that might be useful:
V = 4/3πr3
A = 4 πr2
Code for copying(python)
import math
def volume(radius):
v=(4/3)*math.pi*radius*radius*radius
return v
def surfaceArea(radius):
s=4*math.pi*radius*radius
return s
radius=float(input("Enter the radius : "))
print("Volume of sphere is {}".format(volume(radius)))
print("surface Area of sphere is
{}".format(surfaceArea(radius)))
Write a program to calculate the volume and surface area of a sphere from it radius...
Write a Python program to calculate the volume of a sphere with the radius = 5.
A sphere of radius r has surface area A = 4πr2 and volume V = (4/3) πr3. The radius of sphere 2 is double the radius of sphere 1. (a)What is the ratio of the areas, A2/A1? (b)What is the ratio of the volumes, V2/V1?
Need in C++ Assignment #1: Write a program to ask the user for a sphere radius r as a double. Then compute and display the sphere surface area using S-4*PI'r*r as double. Then compute and display the sphere volume using V-(1.33)*PIr'r*r as double. Use: const double PI-3.14;
Write a program using the class to find out the area of a circle and volume of a cylinder. [* area of a circle=πr2, the volume of a cylinder=πr2*h where h is the height of the cylinder and r is the radius of the circular end of the cylinder] 1. The member variable should be private 2. Use public member functions to execute your program. 3. Use set ( ) function to access the private members 4. Use another approach...
Sphere 1 has surface area A1and volume V1, and sphere 2 has surface area A2and volume V2. If the radius of sphere 2 is 9times the radius of sphere 1, what is the ratio of each of the following? (a) the areas, A2/A1 (b) the volumes, V2/V1
Problem #2 .Calculate the volume and surface area of a torus from the minor radius r and major radius R. The equation for the volume of a torus i:s and the equation for the surface area of a torus is A = 4㎡Ar Your script should read-in values for the minor radius and major radius and display the calculated values with appropriate units. The units should also be read-in. Test your program for the following two cases: . Or-5in and...
modify sample code from example two to calculate the surface area and volume of a sphere givin the radius int main() Example 2 Introduction to structures and passing the structure variables as arguments into functions. 1. A structure is created with circle related variables. 2. Two functions are created related to circle calculations. 3. This example passes structure variables from the main function to the message Circle function 4. The message Circle function converts the structure variables into regular double...
1. Sphere 1 has surface area A1 and volume V1 and sphere 2 has surface area A2 and volume V2. If the radius of sphere 2 is 3.86 times the radius of sphere 1, what is the ratio of the areas A2/A1? 2. What is the ratio of the volumes V2/V1
Sphere 1 has surface area Ai and volume Vi and sphere 2 has surface area A2 and volume V2. If the radius of sphere 2 is 1.84 times the radius of sphere 1, what is the ratio of the areas A2/A1? Tries 0/8 What is the ratio of the volumes V2/V1? Tries 0/8 Submit Answer Submit An Post Discussion Sen