Instructor's solution to Asst.4, Q.1B

This solution presents an incremental development process, which I recommend you to follow on the Final Exam and beyond.

Step 1:  Begin with a very basic version. The purpose of this step is to get a compilable "frame", which you will later build on.

Step 2:  Start working on mathematics. Begin with as direct and primitive approach as possible. This version doesn't yet include any distracting technicalities as, say, a loop (for those who are not comfortable). The purpose of this step is to get a working code that produces the correct result in a sample case.

Step 3:  Analyse repetitions, observe pattern(s), generalize. Concentrate on one thing at a time. In this version I concentrated on the loop. Alternatively, a nice user interface could be implemented before.

Step 4:  After the basic functionality has been achieved for more or less general data, round up nicely. Final version

Back to AMAT 2120 main page