MT262 Block 1

You are here:   Catzwhiskerz Home | Open Uni | MT262 | Block 1

Beginnings.

Block 1 deals with learning the basics of the C++ language in the environment of Borland Builder version 5. Don't worry about trying to get hold of Borland Builder as this will be supplied to you in the first mailing of the course on CD-ROM. Also supplied are CD-ROMs with the Assignment files on them, and the course Libraries. If you should accidently corrupt or lose any of this basic material during the course, you will be able to replace it from the CD-ROMs. So keep them safe! Books on C++ are unnecessary as the course units give you all you need to know; in fact, a book may unsettle you as Borland Builder probably will not be used and so you will feel confused unless you already have other programming experience.

The course books are well-written and provide examples for you to work through as you go along. Each Unit (one per fortnight) contains around 10-12 hours work. Expect to spend 1 to 3 hours per session depending upon the work being done. If a Unit contains a lot of practical computer work then it will obviously take longer to work through. It's best to try to complete a computer session uninterrupted if possible, for continuity of thought process! The course units give an indication of how long a particular section of work is likely to take, and I found these to be reasonably accurate, although I was quicker on some occasions.

One point I should mention which may concern you during the first few weeks of the course is program design. The notation used for program design differs from the actual C++ coding used in a program. This may prove confusing at the outset, but it is worth sticking at. You should get as much practice at writing down program designs and code as possible, as the final exam requires you to write out design and code fragments. Always try to work out program designs and code at your desk, well away from the computer. This will enable you to think through a program rather than try it out at every step. "Can't I just miss out the design notation?" I hear you ask. Not a good idea if you want to be able to answer some of the exam questions!

You will no doubt encounter some hiccups using Borland Builder at the outset of the course. Remember a lot of help can be found in the Pink stop press pages which you get in the first mailing, and towards the end of the course Handbook. Be sure to keep these handy for ready reference. Other problems can usually be sorted out by using the First Class conferences, which are an excellent medium of support.

Do become familiar with the layout of the Handbook. You will be allowed to take this into the exam, although annotation is not allowed (but highlighting and underlining is). The Handbook provides summaries of each Unit and a useful index at the back for the course and where to track down information.

Help! My program doesn't work!

This can be due to a number of problems. When you study Unit 4 you will learn how to debug your programs. This is a very important skill to learn and will help you to get a working program.

Syntax errors

  • A very common mistake is forgetting to put the semi-colon at the end of a statement. Check your code carefully.
  • A less common problem but still one that occurs is putting a semi-colon where there shouldn't be one - for example, after the brackets in a conditional statement.
  • Another source of error can be using = when == was required. I like to think of = as meaning "becomes equal to" whereas == means "is exactly equal to". It isn't uncommon to find you've done this, especially as design notation differs from C++.

Semantic errors
"Help! My program is supposed to output the mean value of 20 numbers but instead gives me the capital of Australia!" Well, probably not quite that bad, but you see what I mean.

  • Getting the logic of your loops correct can be tricky. Run through the loop step by step, noting the changes in variable values as you go, and see whether the outcome is as you expect. Yes, it is tedious, but sometimes it's the only way you can see what's happening. Check where you are incrementing a loop, if that is required.
  • Watch out for those array index values.
  • Visit the First Class conferences if you have problems sorting out a program. If it isn't a TMA question you can post the code. Without a doubt some other bright spark will spot your mistake! Fresh eyes on a problem seem to work. Don't be shy asking for help - others will be glad you asked the question they were too afraid to ask!

TMA preparation

The first TMA in 2002 consisted of 4 questions, Part 1 (question 1) of which is to be submitted (by snail mail, there is no eTMA system for MT262) fairly early on. The other 3 questions that form Part 2 then follow at a later date. These involve writing small programs or designs for programs. Read the questions VERY carefully before beginning to make sure you have interpreted them correctly.

Be warned, questions can be very time consuming, although Part 1 will be quite simple. Tackle each question as you finish the relevant Unit and the material is still fresh in your mind. You will find help and encouragement in the First Class conferences, although direct publication of any of your TMA code is prohibited. Similar examples can be quoted, however, as can relevant exercises from the course books.

TOP

On to Block 2