Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Interfaces and Filter Assignment

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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



BankAccount


Filter


Interface



Tester

 
Marshal
Posts: 70351
283
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic