Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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


image text in transcribed

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

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: 3

blur-text-image

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

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

What favors the formation of continuous (dense) cleavage?

Answered: 1 week ago