General assignment hints

  1. Start as earlier as possible. Even in the case of A5 where we haven't yet gotten to how lists are implemented in Pascal (i.e., one-dimensional arrays) you can still work on breaking down the assignment and work on it in parts. If you wait too long before you even start the assignment, then you will have a great deal of difficulty completing everything (or you may even have a great deal of difficult completing anything).  One example of how you might break things down by creating multiple versions of your assignment is shown below.
  2. Break the problem down into parts like I showed at the end of the section on modular design (when I talked about testing).  Work on each part separately, test each part to make sure that it's working properly before adding it to the main program and moving onto the next part.  That way if you have a logic error in your program you can likely isolate it to the newest part that you are working on.   If you don't do this trying to find a bug in a program that is several hundred lines long can be extremely difficult.
  3. Do attempt all assignments.  As I mentioned in the very first lecture, Computer Science is a very hands-on discipline, you gain the deepest understanding of concepts by trying things out for yourself: write, trace and debug as much code as you can.  (In a similar fashion to working out you won't get a lot of benefit by just watching me do stuff, you have to go out and do things on your own as well).  Even if you only partially complete an assignment that may give you enough of an understanding of some of the concepts to get through your exam.  Or conversely if you get a zero on an assignment because you didn't do it you will likely get a zero on any final exam questions dealing with the same topic and remember that the final exam will include short answer questions such as code writing and code traces.
  4. Back up your work!  Once you get your basic program working make a backup copy (e.g., at Unix type 'cp StarTrek.p StarTrek.June9'.  As you complete additional features backup these versions and don't touch the backups!   When you start working on more features, modify only the copy so you will have a working version to go back to if disaster strikes and you lose the latest version or introduce so many errors into it that you are having trouble fixing it.
  5. Submit your work often and check (via 'submit') what files that you sent (via 'showstuff').  Again if disaster strikes then you will at least have a partially working copy sent in by the deadline.
  6. If you don't understand something even after you attended class then ask for help!   This seems quite obvious but every semester I get students who don't understand particular topics but never ask questions, skip most of the assignments and end up failing the exam.  I won't think that it's stupid to ask for help if you are actually doing the work for this class (such as going to lecture and attempting the assignments) but just can figure something out.  (What I think is not so smart is to not ask for help when you need it).   Remember even though I've been teaching here for almost 4 years I actually started as an undergraduate student sometime at the end of the previous decade1 so I can still clearly recall that I had to work hard at things as well remember where I had ask for help like y'all may have to do!
  7. Don't fall behind.  Again I mentioned this during the first lecture but it is very important so I am reminding you again.  Because the programming concepts are cumulative and build so much on previous concepts if you fall behind then it is highly unlikely that you will ever be able to make up the time and catch up on things.

How to make multiple versions of your fifth assignment:

Version 1: Learning about the basics of modular design (functions and procedures). Since I've outlined in the assignment description some of the functions and procedures that you must implement you won't have spend a great of time planning out how to break things down in order to get started but you do have to get very familiar with the details of how to define and execute the code for these modules.   Your first version could simply be a "skeleton" of all the modules in your program, meaning that all your functions and procedures will be listed but there will be no statements in the body of each module save for some output messages so you know when a particular module is being run.  You can implement the code for the modules in successive versions, the idea for the first version is to determine EXACTLY what you need to create a compilable program that uses and calls functions and procedures.   Also for this version I would write modules that take no parameters because you can always rewrite your function and procedure definitions later.  The first version of your program could look something like this.

Once you have a compilable and working version back it up and DO NOT touch the backup.   Only make your modifications on the copy so that you will always have at least a partially working version if disaster strikes and you have insurmountable logic errors in later versions that you just can't figure out before the assignment deadline.

Version 2: Learning about parameter passing.  You can write your solution as a simpler version of the assignment, e.g., it only allows for a class size with a single student so that you can teach yourself the more advanced concepts of modular design such as parameter passing.  In this version you'll likely only implement a few modules:

  1. initialize
  2. hasNoAccounts
  3. numberOfAccounts
  4. showBalance
  5. makeDeposit
  6. makeWithdrawal
  7. openAccount

With this version of the program, instead of declaring an array of accounts for each account (as described in the assignment) you should declare only a single real number variable in the main procedure and learn how to pass it as a both a value and variable parameter.  The second version of your program could look like this.  This will allow to work figure the logic of some assignment even before you learn about the syntax of how to use an array. 

Again: Once you have a compilable and working version back it up and DO NOT touch the backup.

Version 3: Implementing some more of the required functionality of the assignment program without using an array.  In this version of your program you can actually try to implement some of the more difficult code (transfer between accounts) for the remaining functions and procedures when the customer has two asset accounts.  You can do this by declaring two variables that are real numbers and passing these variables into each module.  Note: This version (which uses multiple declarations of real variables) is NOT the way you should implement your final version.   However doing it in this incorrect way first will give you a much better appreciation for why arrays are so useful...   Once you get this version working it should be a fairly easy to replace the real variables with a single array of real number elements and to make a few slight changes to your modules so that they manipulate a single array rather than just separate variables. 

1 In case skeptical about how true my statements are because you have worked out a few numbers and are wondering how I ended from starting out as a first year student to graduate student to full time faculty member so quickly, I finished my undergrad degree in a little over two years and was hired to work full time while I was still a full-time grad student.