-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operators exercise #439
Comments
I may work on a proposal later on, if you wish. |
I would like to add, that we should prefill the class declaration with two data members for numerator and denominator, probably as Furthermore, I think we could remove |
My improvements are up here: #442 |
Right. I think we should therefore have an exercise before where the students design their own (simple) class, like you say below.
It does not need to be a
Agreed, part of #442.
The exercise leaves it open how to implement the operators, by design. There is also no need to explain how hidden friends work. Students would only know if they looked at the solution, which they should not :)
I removed the chaining of |
Starting with a Fraction class would have the benefit that when they move later on to operators exercise, they are already familiar with the use case. I would not put this in polymorphism, cause I prefer to keep inheritance away when they try their first class. |
Yet their first class may be inspired by polymorphism. For example provide a Pentagon and ask them to write an Hexagon, with no base class and no inheritance at the beginning... Well, as you prefer. Both have different benefits. |
An additional difficulty is that the |
A very good support to discuss the design of a class... but obviously too hard for beginners who never wrote a single class. And I take each time 2 hours to complete it, which prevent from trying other exercices. I would make few suggestions:
multiply
,add
,compare
,print
.The text was updated successfully, but these errors were encountered: