Question: Write a function named triArea() that takes two parameters for base and height of a triangle, calculates the area and returns it. (Hint: The base

Write a function named triArea() that takes two parameters for base and height of a triangle, calculates the area and returns it. (Hint: The base of a triangle is calculated as base * height/2)

Prompt the user to enter base and height of 10 different triangles. Every time the user enters the pair of values, you should call the triArea() function, pass the arguments to function and print the returned result on the screen. (Hint: Use a loop to get values for 10 different triangles from the user)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem well create a function named triArea which will calculate the area of a triang... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!