Malcolm Bibins
,
Greenhorn
Mar 12, 2013 23:35:41
Where exactly am I going wrong?
It highlights the string "turns 21 in" as the error.
Jeff Verdegan
,
Bartender
staff
Mar 13, 2013 01:13:27
It's complaining that you can't do
since that method is void.
Jeff Verdegan
,
Bartender
staff
Mar 13, 2013 01:15:33
In the future, please UseCodeTags (⇐click) when posting code, so it will be readable. I've added them for you this time.
And welcome to the Ranch!
Campbell Ritchie
,
Marshal
staff
Mar 13, 2013 03:03:53
What Jeff means is that you must have something after the + operator. If your method is void, then there is nothing there, and the + operator cannot operate on nothing.
Shannon Graham
,
Greenhorn
Mar 13, 2013 12:13:18
change your method to this:
fred rosenberger
,
lowercase baba
staff
Mar 13, 2013 12:17:07
even better, I'd ditch the Difference variable all together, and just have the method return the computed value each time.
if you insist upon keeping it, at least follow proper naming conventions and call it "difference".
Malcolm Bibins
,
Greenhorn
Mar 13, 2013 12:47:11
Okay. Yeah this helped a ton. Thanks folks.
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com