Last modified 5 years ago Last modified on 2013-02-06 13:00:26

TIEP111 Programming 2 Course assignment instructions

What is the Course Assignment

The course assignment is not a part of your portfolio!

The assignment is a learning situation, where the student attempts to code a program based on his own skills and knowledge. This attempt is then demonstrated to a supervisor, who explains what's right and what's wrong in the program, and what was poorly or clumsily implemented. This method helps to correct bad programming habits in the early stage of studies. These habits can be almost impossible to discard later on.

The assignment has to be demonstrated to the supervisor regularly. "Red marks" aren't marks of shame but hints about what should be rethought (and signs that your supervisor is interested in your work!).

Write in the correct style right from the start! When you code your assignment, use orthodox indentation, reasonable variable names etc. It takes too much time to first write a messy version, and then use 10 hours to change the style when then assignment is almost complete. After you've learned the correct style, it's as easy to use as the messy one.

It's recommended to do your assignment in a group. The group can have a common subject, or everyone can have their own programs, which are then developed together. For example, the subprograms of one can be used by all: one understands the idea, and then explains it to the others. Members can cross test each others' work.

Those with separate assignments have the advantage of getting the work done even if some of the members quit.

You Come Up With Your Own Idea

Naturally it's more motivational for the student to pick his own subject for the assignment. Teachers could make an educational program, exercisers a personal trainer, travelers a log etc.

The idea for the assignment can then be modified with the help of supervisors to meet the requirements of the course.

The goal is first to get a subject that pleases you, the kind of assignment whose usability, functions and usefulness one understands. After the subject is decided, you start to practice designing and programming it.


You should learn the following things while doing the assignment:

  • designing the program (starting from 2011 the desing is done by planing the Graphical user Interface GUI for the program)
  • designing the data structures and object classes
  • dividing the program into parts (methods, program modules)
  • how to use files
  • dynamic data structures
  • how to traverse data structures (search)

Because of these requirements, you should choose the subject so that the data the program uses needs to be stored in a file. The need for data should be quite big so that you can't tell beforehand how much there will be. Typical programs of this kind are different kinds of registries, like the example program of the course.

What you need to take into account while doing the assignment

Usability of the Program

Anyone should be able to use the program. A program meant for more professional use can have fewer instructions than a program meant for everybody.

Who uses the Program

The definition of the problem is quite vague. In order to make the idea for the assignment realizable, you should first ponder how a similar program is used.

For example, let's take a program which can be used to analyze movie goers' age and sex distribution.

Where would this program be used? For example, the management of the film theatre could decide what to run and when based on the data collected.

From where is the data collected? One alternative is to get the movie goers to type in their info on a terminal before they enter a screening, but then the program would really have to be idiot proof. After everyone had gone, the management would examine the processed data, save the results, and then lock the computer.

Universality and Adaptability

Let's say we need a program that can be used to calculate scores in women's gymnastics. The apparatuses, their names and amounts have to be easy to change, so that the program can be used in men's competitions too.


Guidance is gladly given to anyone willing to ask.

You need to book a time for guidance (from Korppi) at least a day before the session. If you can't make it to the session, cancel it (if Korppi won't let you cancel it, send an email to the supervisor). If a supervisor is free at an unreserved time, you can pop in to check if he can help you.

Preparations before a session:

  • Think questions beforehand. What answers do you seek?</li>
  • Always bring the original plan and picture of your data structures.
  • All completed phases and the phase you're currently working on have to be in the WWW, instructions for uploading can be found from here
  • Equipment for taking notes
  • Bring the notes of previous sessions with you
  • All members of the group have to be present
  • Cell phones switched off/in silent mode'''

All preparations must be made before the session. It's not polite to use other people's valuable time to rummage through your bag.

At the session:

  1. there's nothing to be afraid of
  2. critique and corrections are meant to help you become a better programmer
  3. you take down notes unprompted

Writing Style and Comments

The assignment is written and commented in the same style as the example programs near the end of the course handout. Other clear and reasoned styles are acceptable. The following are especially important:

  • Use of variable names, and their descriptiveness
  • Enough good comments
  • It's OK to use example subprograms as they are, but if you modify them, you have to explain the changes in the comments
  • Logicality of indentations (2 spaces/indentation is enough, but don't vary it)
  • Don't use shady numeral or literal constants that may need to be changed later on
  • Correct use of references
  • The program compiles completely without errors or warnings
  • Input works
  • The program has at least one validity check
  • There's some kind of help available in the program
  • There's at least one data structure implemented using normal array
  • There's at least one data structure implemented with Vector, Arraylist or other such class of Java
  • At least one data structure traversal is implemented ("search"). Sorting implemented with the algorithms of Java would be a plus.
  • Adding new "properties" is not too complicated

Phases of the Assignment

The phases of the assignment must be completed in schedule.

1. Preliminary Plan

The first phase of the assignment is the preliminary plan. In this phase you're supposed to examine the problem definition more carefully, and then try to determine what the program is going to be like. Especially every window of your application has to be sketched out. Here we're going to use the example assignment (Finnish version): Main window of the example

All of the windows should be sketched out and scanned/inserted in to your preliminary plan.

It's recommended to write the phase with a text editor (if you use Word, save it in a format that can be viewed in a browser without plug-ins) because it's easier to alter the text after supervisor's feedback. You should also show what data is saved in files, and what the files look like (an ER-diagram helps here, if you have learned how to draw them in another course).

The relational "database" (text-files) plays an important role in the assignment, so design it well. Ideally an assignment should have 2-4 data tables, that have a relation between them (e.g. Person-table references the Hobby-table by hobby_id).

Because the Club program is handed out as an example, your supervisor may modify or add things to the plan, so that the assignment isn't just changing Club to Store and Member to Product.

You should still think about usability. For example, the GUI should follow standard conventions, as not to confuse the user. Use common names for buttons, such as "Save, Delete" and "OK/Cancel".

In any case, the UI should be separate from other parts of the program so that it can be changed easily.

Example of the preliminary plan (Ignore the out-dated command-line interface! Instead, draw sketches out of your GUI and scan/save them to the plan)

2. Manual and the Plan

Changes to the preplan suggested by the supervisor should have been done. The development of the program is based on this plan.

If you come up with improvements later on, you can change the plan if your supervisor approves.

In this phase, you have to actually model the windows and take screenshots of them.

Then, add the screenshots of the Java GUI in to your plan.

Plan of the example program (Finnish version, use Google Translate!)

3. User Interface

In this phase you program a mock-up user interface. For example, if the program is based on menus, you implement the main menu and all submenus. No functionality needs to be present yet.

The program has to always be commented. You must write authors' names and the date of last modification to all the .java-files!

Phase three of the example

4. Data structures and Classes I

For the future development of the program, it's necessary to (at least partly) decide what data structures to use. First you draw pictures of your data structures, and then get your supervisor's approval.

Your data structures don't have to be the same as in the Club program, but its structures can be used in most projects with little, if any, modifications.

In this phase you also design the classes of your program. You describe them either with CRC-cards or a UML-diagram. Show your design to your supervisor.

Do this phase well, and think it through! In previous courses if someone did the phase shoddily, they were in big trouble later on.

Phase four of the example

5. Data Structures and classes II

In these phase every class has to be in its own Java file. For example, the implementation of the Member class is written in the file. Furthermore, the purpose of every class and method has to be documented in the comments.

From this phase on, you can expect your supervisor to test whether you understand the meaning of every line of code in your program (you can have the source with you when he does so).

First you'll implement and test the classes handling individual records (like the Member class in the Club program). You write a small test program in the file to validate correct functionality.

Next you implement and test the container classes (e.g. Members class in Club).

Last the Club class that encapsulates the classes behind common interface.

You need to implement at least one data structure of your own (see Members), and one using existing Java classes (see Hobbies in the example).

Phase five of the example

6. File Handling and Class Cooperation

In this phase the Club program can print members with their corresponding hobbies. When you add a member you also add his hobbies. The program then saves the added data.

You should start by implementing the kind of class cooperation as in the example.

File handling is implemented next.

It's best to structure the program so that it reads necessary files when it's started, and writes data to them when it's closed. It's probably easiest to first implement and test loading, and after it functions, saving (or vice versa).

If not already done in previous phases, you should make the separate parts of the program (user interface, data structures...) function as a whole.

Phase six of the example

7. A Functioning Program

Now you complete the program piece by piece - testing each - according to the original plan. This way you'll complete your assignment, and the finished program functions properly.

All the choices of the submenus don't have to work, as long as you've familiarized yourself with all the essentials aspects of programming and the language used. In the previous phase you've come to an agreement with your supervisor about the parts that need not be implemented.

It's desirable that your program has some kind of simple search. Likewise a sort implemented with the existing algorithms of Java.

For the most part, your program should be as complex as the one in the Club example. It has to work as specified in your original plan!

You shouldn't just blindly copy the example in this phase either because you have to be able to explain every line of code in your source to the supervisor.

Phase seven of the example