Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Declare a class DataSet that computes the sum and average of a sequence of integers. Supply methods:
- void addValue(int x)
- int getSum()
- double getAverage()
- Hint:Keep track of the sum and the count of the values.
- 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