• Post Reply Bookmark Topic Watch Topic
  • New Topic

School exercise  RSS feed

 
kat hok
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, seems straightforward enough.
Could you show us the implementation that you've come up with so far, and where you're stcuk, specifically?
We can take it from there.

Oh, and you should read our policy section on how if you EaseUp (<-click) you're more likely to get help 'round these parts
 
kat hok
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, sorry!

I haven't implemented something, as this is just a writing exercise.

But for a) i) -> for the set method, it ensures n>0. Where I'm stuck is what does this mean for Alice/Bob when it comes to flexibility?

Thanks!
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch


If “requires true” is a precondition, that means that no additional requirements can be applied to that method's users.
What I think the question means is, how are you going to change the class, and what additional preconditions are you going to enforce in order to ensure n is always positive, etc. Are you allowed to change the public access to private? As for flexibility, you will have to consider whether the old version or the new version is easier to write and use, or more difficult. The question is not easy to understand, but it is actually well‑written. You have to think before you write!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!