CS计算机代考程序代写 algorithm junit Take Home Final Exam SE433 Due date : Sunday 03/21/2021 6 p.m

Take Home Final Exam SE433 Due date : Sunday 03/21/2021 6 p.m
Name: ___________________________________________________
Important Instructions:
• You have to write your answers in one .docx or .pdf file with your name in it.
• This is an exam, don’t expect me to answer any question.
• NO LATE SUBMISSION WILL BE ACCEPTED. Missing the due date means no grade.
Submission by email is not accepted.

Question 1 (15 points)
Imagine a program which reads in the length of three sides of a triangle and outputs a message naming the kind of triangle: EQUILATERAL, ISOSCELES, or
SCALENE. Length not in range 1 – 99 cause error message INVALID INPUT. If lengths don’t make a triangle, output NOT A TRIANGLE.
Assumptions (pre-conditions for your program)
1. Three lengths are entered separated by blanks or returns.
2. Input of decimals or characters causes unpredictable results.
3. Input from keyboard, simple text output to display.
4. Even though equilateral triangle is also isosceles, only print EQUILATERAL.
Write a complete set of Black Box test cases for testing of the program which solves the problem above. Create a table like the one below.
Case #
Description
Input Values
Expected Outcomes
1
All values equal
33 3
EQUILATERAL
2
3
4

Question 2 (15 points)
Write two Junit test cases for the following findMax method:
c. Modify the source code to fix the defect(s) that made the test fails
a. Test case that passes
b. Test case that fails according to the specification
Specifications :
Method that returns maximum number for an array that contains positive or negative numbers or null if the array is empty
Source code :
public class Calculation {
public static int findMax(int arr[]){ int max=0;
if (arr.length==0 || arr==null) return null;
for(int i=0;i