Answered step by step
Verified Expert Solution
Link Copied!

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);

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

More Books

Students also viewed these Databases questions