Michael Jung <miju@golem.phantasia.org> writes:
To use the parse() method of a NumberFormat (Eric)
is very close to what I was looking for.
Why doesn't this solve your problem completely?
In fact, it might be so close to what I was looking
for that I can not tell the difference.
(The only thing simpler might be a static method.)
What is missing/excess in:
Number x = NumberFormat.getInstance().parse(argv[0]);
A slight excess here is ?getInstance()?.
A hypothetical ?NumberFormat.parse(...)? would be simpler.
catch (ParseException e)
At this point I have not yet taught exceptions.
I am using a ?frame? for the first lessons which looks like
public class Main
{ public static void main( final java.lang.String[] args )
{ ... }}
The students are asked to use this frame for some lessons
accepting that not all details of it have been explained yet.
Possibly, that frame should more generally be:
public class Main
{ public static void main( final java.lang.String[] args )
throws java.lang.Exception
{ ... }}