Question: Write a direct and indirect recursive method for validating input data for the triangle program. There is a live demo in this module's lecture. The

Write a direct and indirect recursive method for validating input data for the triangle program. There is a live demo in this module's lecture.

The equations for a triangle based on three sides is.

float s = (sA + sB + sC) / 2; float per = (sA + sB + sC);

float area = (float) Math.pow((s * (s - sA) * (s - sB) * (s - sC)), .5);

Write a direct and indirect recursive method for validating input data for

Recursive Triangles Criteria Ratings Pts Documentation Appropriate documentation for each method. 10 pts Direct recursion for initial input getInput method validates input as demonstrated in video lecture. 30 pts Indirect tail recursion from triangles method Program continues to "iterate" without any loop structure. 30 pts Terminates with negative input for side A 10 pts Successful run 20 pts Program duplicates performance of demo from lecture Total Points: 100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!