Click to See Complete Forum and Search --> : Having trouble understanding/setting-up program...(Java related)


Cod
09-23-2003, 02:14 AM
Yesterday, my professor gave us an extra credit assignment which is due on September 30, 2003. I'm having trouble getting a feel for what she is asking as well as how to go about coding the program. You can read the exact project assignment sheet HERE. (http://mimic.recongamer.com/cod/project.doc) I've just been staring at the assignment sheet for 20 minutes and haven't come up with anything. I'd greatly appreciate it if someone could point me in the right direction so I can get started and help me set-up the program.

And please don't write the full program the program for me. Though a nice gesture, I would rather learn the art of JAVA programming than have someone do it for me while I don't learn a thing.

rock
09-23-2003, 09:25 AM
What part(s) are you having a problem with?

It appears there are two bits - the reading of the input file and the computing of the solution.

As for the file reading, a simple comma-separated-value file could be read pretty easily with java.io.LineNumberReader and then parsed with a java.util.StringTokenizer into the three input values.

Then, it's just a matter of computing a value for "d", after which the required "if" (or "switch") comes in to play. Looks like you might need another "if" to test for a==0.

Cod
09-23-2003, 02:39 PM
I'm having trouble getting started with setting up variables, if statements, etc.. I'm trying to write an algorithm before I program it because she wants to see a typed algorithm before we start to code the program.

I think the way you explained it gave me a good idea. Thanks a lot for the help so far.

EverlastingGod
09-24-2003, 11:34 AM
Originally posted by Cod
I'm trying to write an algorithm before I program it because she wants to see a typed algorithm before we start to code the program.


Start out general and refine each step... First, you should just be writing how you'd solve it w/o a computer.

For example, start with:

repeat until done
- read input
- compute
- write output

Then break each of those steps down.