Answer to Question #144142 in Python for Chloe

Question #144142
Ask the user to enter the values for sides A, B, C, D, and E and print out the total room area.

Remember the formula for finding the area of a rectangle is length * width and the area of a right triangle is 0.5 * the base * height.

Please note the final area should be in decimal format.
1
Expert's answer
2020-11-13T13:24:47-0500
print('Please, enter sides lengths:')
a, b, c, d, e = map(float, (input('A = '), input('B = '), input('C = '), input('D = '), input('E = ')))
rect_area = a * b
triang_height = (c**2 - (a / 2)**2)**0.5
triang_area = 0.5 * a * triang_height
area = rect_area + triang_area
print('Total room area: %f' % area)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS