Assessment 1: hints


So, if you are any kind of a normal human being, this project will seem absolutely terrifying. That's because this is the first time you need to write a whole program without direction. If you feel lost and have suddenly realised you can't program, that entirely normal -- this assessment is where you actually learn programming, and, in the main, that's the reason we set it -- to give you the space to actually learn how to write something.

Being faced with a blank file and having to construct something will be terrifying. The secrets to this process are two:

a) remember that all coders spend time debugging. Programming is not writing a program and it working straight away; no human can do that (or rarely, anyhow). All programmers write code that then needs debugging -- that's what coding *is*, writing the code and then getting it running. 50 to 90 percent of time on a program is spent getting it working, and there's no reason anyone will be any different. All that changes when you become a good coder is the issues become harder, as you try harder things.

b) Baby-steps! Sit down and thing through the algorithm you are building to, but then put that slightly to one side and think "what is the simplest thing I can do to more forward?" Write that, and get it working. If you keep doing that a step at a time, you'll suddenly realise at some point you've written most of your code.

With this in mind, here's how I'd approach coding this project:

1) Save the two class files I've given you into a directory with the files from the practicals.

2) Strip the contents out of the Analyst class's constructor, and replace it with "Hello World" code. Compile, and check it runs. This confirms the basic structure is sound.

3) Make an object variable out of DataReader.java. Compile and check it runs.

4) Get the array out of the DataReader object, and check it at position [0][0]. This proves you have the data.

5) Build a nested for-loop structure and run through the whole array, printing it to the screen.

6) Make a results array the same size as the data array before the for-loops, and in the for loops copy the data from the data array into the results array. Print the data in the results array. This proves you can copy from position [i][j] in one array into your other array. You now have the fundamental structure you need

7) Implement the project algorithm, remembering the boundary issue.

That said, there are other things you could do, for example, using the Display.java class to display the arrays as images. It's your project, so it is up to you to think it through. The main thing is to take it a small step at a time.