1. area_of_equilateral_triangle An equilateral triangle is a triangle whose sides are all the same length, so all of its internal angles are 60 degrees. Write a function to compute its area, given the length of a side, a. Recall (or look up) that the formula for the area of an equilateral triangle is (V3 / 4) * a? Sample calls should look like: >>> area_of_equilateral_triangle (10) 43.30127018922193 >> area_of_equilateral_triangle(2.5) 2.7063293868263707

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 12PE
icon
Related questions
Question
1. area_of_equilateral_triangle
An equilateral triangle is a triangle whose sides are all
the same length, so all of its internal angles are 60
degrees. Write a function to compute its area, given the
length of a side, a. Recall (or look up) that the formula
for the area of an equilateral triangle is (V3 / 4 ) * a²
Sample calls should look like:
>> area_of_equilateral_triangle(10)
43.30127018922193
>>> area_of_equilateral_triangle(2.5)
2.7063293868263707
Transcribed Image Text:1. area_of_equilateral_triangle An equilateral triangle is a triangle whose sides are all the same length, so all of its internal angles are 60 degrees. Write a function to compute its area, given the length of a side, a. Recall (or look up) that the formula for the area of an equilateral triangle is (V3 / 4 ) * a² Sample calls should look like: >> area_of_equilateral_triangle(10) 43.30127018922193 >>> area_of_equilateral_triangle(2.5) 2.7063293868263707
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr