Bear in mind that I started with Scala a week ago.
Classes: Currency - Abstract, Bitcoin, Dollar, Euro
Traits: Converter, Printer
My Abstract Class has 2 variables: Name and Value (both vars)
Method in Converter Trait
def convert(to:Currency):Double = ???
This is the part where I am stuck. I need to override this method in each of my subclasses (Currencies) so that they convert from one Currency to the other two. I can do it with new methods but it needs to be done with one. What should I pass as a Parameter so that the Method recognizes which one to convert it to. Euro, Dollar & Bitcoin take only one Int as a parameter.
What I also do not understand is this "to: " part of the parameter.
Since this is also my first question on Stack Overflow, and I am not quite sure how all this works, I would like to point out that i am looking forward to pointers and/or suggestions, since the simple solution wouldn't help me at all in the long run. If some of you think I left out some critical information, feel free to tell me, I will gladly edit my question.