UCL Logo

1007 Principles of Programming 2005

Java Mini-Project


Deadline: The printed version of your work must be handed in to the departmental office by noon Thursday 17th November 2005. In addition, a version should be submitted electronically using the handin program (details will be emailed closer to the deadline). Note that the electronically submitted version of your program will be run through an automated plagiarism detector.

Aim: You are asked to write a program of greater complexity than those you have typically been writing to answer the Exercise questions. Your program might be a larger one-class program or it might consist of a small number of classes. The design of your program will require more thought and planning, and at least the use of methods.

Marking: The work will be graded A-F.
On this scheme a grade C is considered to be basically satisfactory which means the program runs, does the more or less the right things and has a reasonable design using methods and possibly several classes. Grades B and A represent better and excellent programs, while D and E are progressively less good programs that show serious problems in execution and/or design. Grade F means a failure to present anything of merit.

Getting a good grade: Marking will take into account the quality of the program you write. In particular pay attention to the following:

  • Proper declaration and use of methods.
  • The layout and presentation of the program code.
  • Appropriate selection of variable and method names.
  • Appropriate use of comments to make sure that your code can be read and understood. Don't add comments that should be obvious by reading the code.
  • Selection of a suitable design to provide an effective solution to the problem in question.

A clean simple working program, making good use of methods, is considered better than a larger and more complex but poorly organised program.

Development Advice:

  • Keep things simple!
  • Keep things simple! (Very important so I've repeated it.)
  • Simple does not mean trivial.
  • First brainstorm/doodle/sketch to get a feel for the program you need to write and what it should do.
  • Don't rush into writing Java code if you don't fully understand what variables or methods are needed. Don't let the detail of writing code confuse your design thinking.
  • How is the behaviour of the program implemented in terms of methods calling each other?
  • Role play or talk through the sequence of method calls to make sure everything makes sense.
  • Are your methods short and cohesive?
  • Can't get started? Do a subset of the problem or invent a simpler version, and work on that to see how it goes. Then return to the more complex problem.

The Mini-Project Ideas

Below are listed a number of mini-project ideas. You choose one idea (not all of them!). The projects vary in difficulty, so choose one that matches your current progress.

The project descriptions are deliberately fairly open-ended, providing scope for the project idea to be extended as you feel able. A number of the projects involve using data files. See the web pages about the classes FileInput and FileOutput to find out how to read and write files. If you want to add a GUI or add other more advanced features then you are free to do so. Beware, however, of getting too ambitious too early. Get something basic working first and progressively extend it.

  1. Write a program that functions as a register for a problem class. It should be possible to add and remove names, add and remove class dates, record whether a person was present at a class and display a report of who was present at a selected class. Data should be stored in a file.

  2. Write a program that can be used by a newsagent to manage newspaper delivery rounds. It should be possible to performs oprations such as add a street, the houses on a street and the newspapers to be delivered to each house. It should also be possible print reports, such as a summary of the papers for a delivery route, and to calculate the weekly paper bill for each house.

  3. Write a diary program, organised by day, week, month and year. It should be possible to add appointments to each day and allow for repeated appointments. The program should also be able to display a week or month neatly. It should also be possible to search the diary.

  4. Write a program to compare two different versions of a text file, including program source code, and list the differences between them (like the Unix diff command). The output should display each line of text that differs.

  5. Write a program that determines the layout of a collection of posters of different sizes on a notice board. Posters should not overlap. If there are too many posters to fit on, the user should be able to select which one(s) to leave out or let the program select the posters to maximise the number that can be displayed (or similar options). Use graphics to display the layout.

  6. Modify and extend the Robot program, so that it can create and display random mazes of different sizes, and implements a robot algorithm that finds and displays the path through any of the mazes.

  7. Design and implement a BigReal class, to provide objects representing real numbers of unlimited size. Provide methods to do addition, subtraction, multiplication and division. Implement a test program to demonstrate the use of the class. (Don't use the equivalent class from the Java class libraries!)

  8. Propose your own idea BUT you must get my approval first (email me — G.Roberts@cs.ucl.ac.uk ). You will need to convince me your idea is better than any of those above. Make sure your idea is practical in the time available and is a suitable challenge.
Last updated: September 1, 2006

Computer Science Department - University College London - Gower Street - London - WC1E 6BT - Telephone: +44 (0)20 7679 7214 - Copyright 1999-2006 UCL


 Search by Google