CodeSolved

A comprehensive source of programming questions and exercises

The calculation of the volume and area of ​​the butter

Practice Easy 348/ Download 1415 Views

Write a program that receives Qatar and prints the volume and area of ​​Korea.

Korean volume formula = radius with power of 3 x pcs X four -thirds (3/3).

Korean area formula = radius to 2 x pcs X four (4)

10 Answers

# Note in the case of Qatar's writing question, not a radius
P=float(input("P:"))
print("S:",P/2*P/2*3.14*4,"V:",3/4*3.14*P/2*P/2*P/2)
Farbod.313 Download Python
gh=float(input("gh:"))
sho=(gh/2)
hag=(sho**3)*(3.14)*(4/3)
ma=(sho**2)*(3.14)*4
print(hag)
print(ma)
def kore():
    """
    تابع حجم و مساحت کره را محاسبه میکند
    """
    radius = int(input("please enter the radius :")) # Getting the radius
    volume = (radius**3) * (3.14) * (4/3) # Volume calculation
    area = (radius**2) * (3.14) * (4) # Calculate area
    return f"hajm : {volume:.2f}\nmasahat : {area:.2f}" # Save the volume and area of ​​2 decimal places
print(kore()) # Farakhani
ghotr = float(input("lotfan andazeye ghotr ra bar hasb cm vared konid: "))
print("hajme kore = ", ((ghotr/2)**3) * 3.14 * 3/4, "cm**3")
print("masahate kore = ", ((ghotr/2)**2) * 3.14 * 4, "cm**2" )
a=float(input("enter the ghoter:"))
b=a/2
hajm=(b**3)*(3.14)*(3/4)
masahat=(b**2)*(3.14)*4
print(hajm,"hajm")
print(masahat,"masahat")
Roghaye.m Download Python
g=float(input('gotr:'))
f=g/2
hajm=(f*f*f)*3.14*3/4
masahat=(f*f)*3.14*4
print('hajme kore:',hajm,'masahate kore:',masahat)
Maryam.n Download Python
def kore(r):
    hajm = 0.75 * 3.14 * (r**3)
    masahat = 4 * 3.14 * (r**2)
    return hajm,masahat
print(kore(r=int(input("enter your number:"))))
                    
def kore(r):
    pi = 3.14
    x = pow(r,3)
    y = pow(r,2)
    hajm = 4/3 * pi * x
    masahat = 4 * pi * y
    return f"hajm kore: {hajm} , masahat koreh: {masahat}"
print(kore(r=int(input("enter your number:"))))
worodi = int(input("ghotr: "))
h = worodi/2
g = h**3
gh = g * 3.14
natije = gh*4/3
ff = f** 2
fnatije_2 = ff*3.14*4
print("hajm kore:",natije)
print("masahat kore:",fg)
User 2187 Download Python
import math
def main():
    # Get the diameter of the user
    diameter = float(input("لطفاً قطر کره را وارد کنید: "))
    
    # Calculate the radius
    radius = diameter / 2
    
    # Calculate the volume of butter
    volume = (4/3) * math.pi * (radius ** 3)
    
    # Calculate the area of ​​Korea
    surface_area = 4 * math.pi * (radius ** 2)
    
    # View results
    print(f"حجم کره: {volume:.2f}")
    print(f"مساحت کره: {surface_area:.2f}")

if __name__ == "__main__":
    main()
Mma123 Download Python

Submit answer

Submitting answers is currently unavailable.

Related content

Detection using AI
×
×
Close