Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. Declare a class DataSet that computes the sum and average of a sequence of integers. Supply methods:
  2. void addValue(int x)
  3. int getSum()
  4. double getAverage()
  5. Hint:Keep track of the sum and the count of the values.
  6. Then write a test program DataSet Tester that calls addValue four times and prints the expected and actual result.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement