INT21OOP Object Oriented Programs
Assignment 1 Semester 1 2006
Value: 20% of Subject Assessment
Due: Fri 28 Apr 06 (week 8)
"Creatures"
Taking an object-oriented approach, design classes for a "Creatures" simulation and then code the simulation in Java providing a simple Graphical User Interface (GUI).
Use a subclass of JFrame as a frame for your GUI panels. Make sure that its title contains your name and student number.
The main focus of this assignment is the design and implementation of interacting problem domain classes. Details of required documentation and submission are given after the description of the simulation.
Description of simulation
A block of land is divided into 15 plots. Every day there is a chance that it may rain on a number of plots. When it rains on a plot there is a chance that food will grow. Creatures occupy plots until they die. Every day they look for food to eat.
The following rules apply.
-
The number of creatures that occupy the land is decided at the beginning of the simulation.
-
At least one creature occupies the land but never more than 15.
-
At the beginning of the simulation, no more than one creature occupies one plot.
-
During the simulation, up to two living creatures may occupy the same plot.
-
For each day, the weather for each plot is set at sunrise. It will either rain on a plot or be fine.
-
For each plot, there is a 50-50 chance of rain.
-
If it rains on a plot then one item of food grows there.
-
At the beginning of the simulation, there is no food on any plot.
-
There are never more than 3 items of food per plot.
-
Each item of food is either NUTRITIOUS, JUNK, or POISON.
-
There is a five in 16 chance that it will be NUTRITIOUS.
-
There is a 10 in 16 chance that it will be JUNK.
-
There is a one in 16 chance that it will be POISON.
-
Every day for dinner, if food is available on the plot it occupies, a living creature eats.
-
It eats only one item of food.
-
If there are two creatures on the one plot, it does not matter which creature eats first.
-
It does not matter in which order food is eaten.
-
Creatures are either HUNGRY, FULL, HAPPY, or DEAD.
-
Every day at sunset, a HUNGRY creature may move.
-
It looks for a plot with food.
-
It cannot move to a plot that already has two living creatures occupying it.
-
Only one move per day is permissible.
-
Creatures have a life span and an age (in days).
-
The maximum life span is 25 days.
-
A creature dies (DEAD) as soon as its age exceeds its life span.
-
A creature is affected by the food it eats.
-
NUTRITIOUS food makes a creature HAPPY
-
JUNK food makes it FULL and reduces its lifespan by one day
-
POISON kills the creature (DEAD)
Documentation and Submission
For your external documentation, create an html document with the following content.
-
Your name and student number.
-
Design diagram(s) showing the relationships between the main classes that make up your application. Use Violet to create the diagram(s) and generate the image(s).
-
A UNIX style man entry with NAME, SYNOPSIS, DESCRIPTION, FILES, WARNINGS, LIMITATIONS, DIAGNOSTICS and BUGS sections.
-
The Test Plan using a table format and showing for each test conducted: reason, data used, expected result, indication of actual result, and a link to actual output from tests (screen capture images from actual runs).
Hand in the following.
-
Program source code listing (.java files).
-
Your signed statement of authorship.
Email me the following.
-
Your jar file executable (I will run the program to assess it).
-
The address (URL) of your html file (or attach the html file to the email).
Consult the following for further information about Unix man page entries and internal program documentation (comments).
Documenting Guidelines External Documentation Example
|
Marking Scheme
|
mark
|
|
Design Diagram(s) : correctness and quality of OO design
|
3
|
|
Class implementation : OO approach expected, assessed from source listing
|
3
|
|
Program Performance : requirements met, assessed via program run
|
3
|
|
Test Plan : thoroughness and quality
|
3
|
|
Basic GUI interface : assessed via program run and test output
|
2
|
|
UNIX style man entry
|
2
|
Implementation and Style : excellence of application
performance, code, comments, interesting GUI
GUI mark available only to those who have met expected requirements
|
4
|
|
Total
|
20
|
Penalties
Assignments not accompanied by a signed statement of authorship (available from the office) will not be accepted.
Penalties as specified in the Unit Outline Semester 1 2006 apply.
Fran Soddell
last updated 15 Mar 06
F.Soddell@latrobe.edu.au