This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Interfaces and Filter Assignment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Interfaces and Filter Assignment" Watch "Interfaces and Filter Assignment" New topic

Interfaces and Filter Assignment

Ron Ingram
Ranch Hand

Joined: Mar 11, 2011
Posts: 73

I have been working on this assignment for Interfaces and Filters. I keep getting back a bad average and I cannot determine why, however I thought I was going to be able to figure this out. Does anybody see the mistake?

DataSet Class





Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45286
It is difficult to know why you got poor marks.
A few points:
  • Why is the Measurer interface not a parameterised type, like Measurer<T>?
  • Same for DataSet and Filter.
  • I don’t like your allowing a null for maximum. See if you can start it off with some default value, maybe one returning 0.
  • The average of 1, 100, 2000, 950 and 4000 is not 3000. What result are you getting and what did you get when you tried it with a calculator?
    I agree. Here's the link:
    subject: Interfaces and Filter Assignment
    jQuery in Action, 3rd edition