LAB2
LAB2
Draw a flowchart
to convert from Fahrenheit to Celsius. C = 5/9 (F – 32)
An instructor calculates the grade percentage based on the highest score on a test. Given the
highest score and one student’s score, draw a flowchart to calculate and print that
student’s test percentage.
Percentage = Score/Highest Score * 100
3- Write a solution to compute Sphere Volume Sphere Volume = 4/3 * Pi * (radius)3
import math
def compute_sphere_volume(radius):
"""
"""
if radius < 0:
return volume
if __name__ == "__main__":
try:
volume = compute_sphere_volume(radius)
except ValueError:
print("Please enter a valid number for the radius.")
4- Write a solution to compute Triangle Area?
Area=.5×Base×Height
"""
"""
return area
if __name__ == "__main__":
try:
except ValueError:
print("Please enter valid numbers for base and height.")