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.
expectation is the root of all heartache - shakespeare. tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your databasehttps://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database