This code is partially from the book Simply Programming An Application Driven Tutorial Approach. Some of the code I have inserted myself to complete the assignment, which is:
The user enters a starting and stopping speed range and the program produces a chart of speeds and stopping distances.
The module should receive 1 data (argument=parameter), an integer representing the speed of travel. The module should convert that speed into the number of feet needed to stop using the formula given above. The module should return the number of feet.
I don't want any answers but just look at my code if you would be so kind and drop some hints as to what I am doing wrong. I keep getting an error message that says:
C:\Test4.java:147: class, interface, or enum expected
}
^
And:
--------------------Configuration: <Default>--------------------
java.lang.NoClassDefFoundError: Test4
Caused by: java.lang.ClassNotFoundException: Test4
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: Test4. Program will exit.
Exception in thread "main"
Process completed.
I am having trouble figuring out how to return more than one value from this method. From the picture I attached it appears I would have to return several values to have calculated all of those stopping distances between the first and the last one. The only thing I could think of was to put the method in a for loop and call it as many times as needed to keep delivering the return values but I can't seem to get it right.
Any help would be appreciated.
Thanks,
Von