Question: pls code for Junit testing in intellj Add an Integer property called DropLowestest if 0 then include all grades in this sum. If set to

 pls code for Junit testing in intellj Add an Integer propertycalled "DropLowestest" if 0 then include all grades in this sum. If

pls code for Junit testing in intellj

Add an Integer property called "DropLowestest"

if 0 then include all grades in this sum.

If set to "N" where N is > 0 - then drop the lowest 'N' score and make average use the other scores

If set to a Negative number then throw an exception

Change this method and write a proper set of tests to test it.

include in comments of EACH test

1-2 sentences that describe WHY you created it.

You have provided the full code, you need to provide the test scenarios in the class called EnrolledStudentTest.java, include new method (dropthelowestscore) and provide code for all your tests:

Enrolled Studentjava Enrolled Student Test.java import java.util.ArrayList; 1 2 4 5 6 public class Enrolledstudent { String fName; Strine 1Name; String id; ArrayList grades; 7 8 9 10 11 public EnrolledStudent(String fllane, String Name, String id, ArrayList grades) { this. Name - fNane; this. INane - INane; this.id = id; this.grades = grades; } 12 13 14 15 17 public String getName() { return fNane; ) 18 19 20 21 22 public void setName(String fName) { this. Nane - fNane; 24 25 public String getName() { return 1Nane; } 26 27 28 public void setName(String lName) { this. IName - Name; ) 30 } 39 49 41 public ArrayList getGrades() { return grades; } 42 43 44 45 46 47 48 49 50 51 52 public void setGrades (ArrayList grades) { this.grades = grades; } public Double getGradePercent() { Double percentage - 0.8; Double sum = 0.0; for( Double er : grades) { sum += er; } double aver = sun/grades.size(); if (aver 100 ) throw new IllegalArgumentException("Percentage must be between @ and 100"); } return aver; } public boolean ispassine() { 53 54 55 56 57 58 59 58 59 6e ) public boolean ispassing() { String 1Gr -getLetterGrade(); if ( 1gr.equals("F") || iGr.equals("")) { return false; } 61 62 63 64 return true; 65 66 67 68 69 70 public String getLetterGrade() { String 1Gr = "F"; double aver = getGradePercent(); if ( aver >= 90 ) IGT = "A"; else if (aver >= 80 ) 16 = "B"; else if (aver >- 70 ) IGC = "C"; else if ( aver >= 60 ) IGT - "D"; return lor; } 71 72 73 74 Enrolled Studentjava Enrolled Student Test.java import java.util.ArrayList; 1 2 4 5 6 public class Enrolledstudent { String fName; Strine 1Name; String id; ArrayList grades; 7 8 9 10 11 public EnrolledStudent(String fllane, String Name, String id, ArrayList grades) { this. Name - fNane; this. INane - INane; this.id = id; this.grades = grades; } 12 13 14 15 17 public String getName() { return fNane; ) 18 19 20 21 22 public void setName(String fName) { this. Nane - fNane; 24 25 public String getName() { return 1Nane; } 26 27 28 public void setName(String lName) { this. IName - Name; ) 30 } 39 49 41 public ArrayList getGrades() { return grades; } 42 43 44 45 46 47 48 49 50 51 52 public void setGrades (ArrayList grades) { this.grades = grades; } public Double getGradePercent() { Double percentage - 0.8; Double sum = 0.0; for( Double er : grades) { sum += er; } double aver = sun/grades.size(); if (aver 100 ) throw new IllegalArgumentException("Percentage must be between @ and 100"); } return aver; } public boolean ispassine() { 53 54 55 56 57 58 59 58 59 6e ) public boolean ispassing() { String 1Gr -getLetterGrade(); if ( 1gr.equals("F") || iGr.equals("")) { return false; } 61 62 63 64 return true; 65 66 67 68 69 70 public String getLetterGrade() { String 1Gr = "F"; double aver = getGradePercent(); if ( aver >= 90 ) IGT = "A"; else if (aver >= 80 ) 16 = "B"; else if (aver >- 70 ) IGC = "C"; else if ( aver >= 60 ) IGT - "D"; return lor; } 71 72 73 74

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!