I get a bunch of error messages
What should happen is that you get the input looking like this (abbreviated) before you push the preview or submit buttons:-
Robert Manley wrote:. . . What am I doing wrong? . . .
Robert Manley wrote:
Copied java file into this window, highlighted and pressed "code" button.
Then clicked "preview".
No change. no line numbers.
What am I doing wrong?
Particularly annoying as I know I have done it correctly in the past.
Lots of print statements are useful at the development stage to allow you to see what the program is going, so they are all right.
Robert Manley wrote:. . . I know I have been repetitive in some cases with the 'println' statements . . .
If you haven't got a good explanation for making something static, I get suspicious if I see anything static.
I am still unsure of the relative merits of 'static'.
What appens if you print the ratio field? What do the printRational, invert, and divide methods do?
Attached is my latest version. . . .
Fred Kleinschmidt wrote:Your variables num and denom are declared as int. This will give what might seem to be surprising results for ratio. For example, with num=10 and denom=40, ratio will be zero. The variables num and denom should be doubles.
I miss the old days when I would think up a sinister scheme for world domination and you would show a little emotional support. So just look at this tiny ad:
the value of filler advertising in 2021https://coderanch.com/t/730886/filler-advertising