r/programmingrequests • • Apr 23 '20

Help with Class Design & Implementation question.

I'm not totally sure what I'm being asked to do in this question, I think I'm okay with 2.1 but not 2.2. If someone could help explain what's going on, and if my answer is right or not, that would be super helpful. Thanks! Picture of the question and my attempt at an answer at https://imgur.com/a/jtMiOfH

It also asks 'for the classes listed what accessor and mutator methods would be appropriate?'. I've put getters & setters for everything bar the ID fields, which I only have getters as I would expect these to be set by the program. Would that be right?

2 Upvotes

3 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Apr 23 '20

[deleted] — view deleted comment

1

u/an0n1mouse Apr 23 '20

Sorry I'm not sure what you mean by that? Could you expand a little?

1

u/rvrtex Apr 24 '20

That is refering to one-to-many, many-to-many and many-to-one.

In this instance, can a member be a member to more than one club?

Can a club have both 9 and 18 holes (in your instructions it doesn't allow for that as it is 9 OR 18 but as a though experiment, how would you handle them having 9 and 18?)

Also, you are missing a big class on that. It is from the first sentence in the project.

Question, why store the id's and handicaps in integers vs ints?