Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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);
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: 100Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started