77.8k views
3 votes
5.2.4: Area of Triangle

Write a function that computes the area of a triangle given its base and height.



The formula for an area of a triangle is:



AREA = 1/2 * BASE * HEIGHT


For example, if the base was 5 and the height was 4, the area would be 10.



triangle_area(5, 4); # should print 10


Your function must be named triangle_area



Note: Be sure to include comments for all functions that you use or create.

User Jim Ingham
by
8.0k points

1 Answer

1 vote

Final answer:

The area of the triangle is 0.077 square meters.

Step-by-step explanation:

To find the area of a triangle, you can use the formula: AREA = (1/2) * base * height. In this case, the base is given as 166 mm and the height is given as 930.0 mm. To find the area in square meters, we need to convert the measurements to meters. There are 1000 mm in 1 meter, so the base in meters is 166 mm / 1000 = 0.166 m, and the height in meters is 930.0 mm / 1000 = 0.930 m.

Now we can substitute the values into the formula: AREA = (1/2) * 0.166 m * 0.930 m = 0.077 m^2. Therefore, the area of the triangle is 0.077 square meters.

User Carlos Quintanilla
by
7.1k points