Question: This question requires you to use the following specification for processing a list of integers that computes the total and average for the positive


This question requires you to use the following specification for processing a

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. 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 State any assumptions you make when answering this question. (a) Draw a state machine using the specification above to process the list of integers. Use StarUML to draw your state machine (statechart), copy and paste the state machine into your answer document. You are required to submit the StarUML file with the state machine along with the answer sheet in a zipped file. (b) Write test cases that satisfies the all states and all transitions criteria using the state machine in (a). (c) Using the Eclipse IDE (or other IDE) write well documented code for a class (Q5Class) that processes a list of Integers as specified above. (d) Write well documented JUnit test cases in two classes (Q5AllStates Tests - 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. Copy and paste the code for the Q5Class and the associated test classes (Q5AllStates Tests and Q5AllTransTests) into your answer sheet. (e) Copy the results after running the Q5AllStates Tests and Q5AllTrans Tests and place the screen shots showing the results into your answer sheet using an appropriate screen capture approach.

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 Programming Questions!