Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(Exercise 9.7 of [Priestley; 2004]) The code below shows a class DataSet, which provides basic statistical functionality on a set of data, and a class
(Exercise 9.7 of [Priestley; 2004]) The code below shows a class DataSet, which provides basic statistical functionality on a set of data, and a class Marks, which uses DataSet to store and work out the average of a set of marks. The main function is shown reads in two marks and uses Marks to store them and print out the average. Draw a sequence diagram showing the interaction that takes place when the main function executes.
class DataSet { private float data[]; private int items; public DataSet() { data = new float[256]; items = 0; } public void addDataPoint(float d) { data[items++] = d; } public float mean() { float total = 0; for(int i 0; iStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started