Home / Expert Answers / Computer Science / this-question-requires-you-to-use-the-following-specification-for-processing-a-list-of-integers-that-pa924

(Solved): This question requires you to use the following specification for processing a list of integers that ...



This question requires you to use the following specification for processing a list of integers that computes the total and average for the positive integers. Note the list may contain both positive and negative integers. You should use at least the following pseudocode operations when computing the total and average.                                               [35]

private void addTotal(num) – adds the num to the total

public int getTotal() – returns the total

private void setAverage() - computes the average

public float getAverage() – returns the average

public void processList(list) – passes in a list of integers and processes

                                                                                  the list

 

Using the Eclipse IDE (or other IDE) write well documented code for a class (Q5Class) that processes a list of Integers as specified above

Write well documented JUnit test cases in two classes (Q5AllStatesTests – containing only test cases for all states, and Q5AllTransTests – containing only test cases for all transitions) for the test criteria in part (b) in the Eclipse environment (or other environment) and test the class Q5Class.

                                                                               



We have an Answer from Expert

View Expert Answer

Expert Answer


Attached the code for further reference :- Please upvote if you find this answer helpful (: import java.util.*; public class PositiveIntegers { static List li = new ArrayList<>(); static int
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe