Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create structural JUnit test cases that account for 100% or near 100% coverage for the program below 1 public class TriangleType t // The main

Create structural JUnit test cases that account for 100% or near 100% coverage for the program below

image text in transcribed

1 public class TriangleType t // The main triangle classification method public static int triangleType(int Side1, int Side2, int Side3) 4 int triOut; /7 triout is output from the routine: / Iriang 1 if triangle is scalene /I Iriang2 if triangle is isosceles I Iriang 3 if triangle is equilateral / Iriang 4 if not a triangle /I Iriang 5 if the inputs are out of bounds 12 13 14 15 16 17 18 19 20 // After a quick confirmation that it's a valid // triangle, detect any sides of equal length triOut = 4; return (triOut); 23 24 25 26 27 28 29 30 31 32 if (Side 1000 II Side2 1000 II Side3 1000) triOut = 5; return (triOut); 34 35 36 37 38 39 40 if (Side1 = Side2 ) if (Side1-= Side3) if (Side2Side3) if (triout0) tri0uttriout + 1; triOuttri0ut 2; triOuttri0ut3; // Confirm it's a valid triangle before declaring // it to be scalene if (Side1+Side2- Side3 I Side2+Side3Sidel else return (triOut); Side1+Side3Side2) 42 43 triout 1: 45 46 47 48 49 50 51 52 53 54 // Confirm it's a valid triangle before declaring // it to be isosceles or equilateral if (triOut > 3) else if (triout1 && Side1+Side2 > Side3) else if (triOut2 && Side1+Side3 Side2) else if (triout3 && Side2+Side3 > Side1) triOut = 3; triout 2; 56 57 58 59 60 61 62 63 64 F 65 triOut 2; else triout 4; return (tri0ut); // end Iriang

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_step_2

Step: 3

blur-text-image_step3

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

More Books

Students also viewed these Databases questions

Question

2. Identify issues/causes for the apparent conflict.

Answered: 1 week ago

Question

3. What strategies might you use?

Answered: 1 week ago