FIT9131-Koala-Rescue

Introduction

Please note the section on plagiarism in this document.

In preparing your request please note the following:

The request must be done using the BlueJ environment.
The Java source code for the request must be implemented according to the FIT9131 Java Coding Standards.
You must acknowledge all code in your request that you have taken from other sources.
Only a text interface is to be used for this program, there is to be no GUI. More marks will be gained for a game that is easy to follow with clear information/error messages.
Any points needing clarification may be discussed with your tutor in the lab classes. You should not make any assumptions about the program without consulting your tutor.

Completion of this request contributes towards the following FIT9131 learning outcomes:

design, construct, test and document small computer programs using Java;
interpret and demonstrate software engineering principles of maintainability, readability, and modularisation;
explain and apply the concepts of the “object-oriented” style of programming.

Specification

For this request you will simulate the work of a koala rescue team. This section specifies the required functionality of the program.

Background

The koala is a marsupial and is native to Australia. Koalas typically live in open eucalyptus (gum tree) forests. Koalas live mainly in trees and eat up to 1 kg of leaves per day. Their diet is restricted to a few varieties of gum trees (e.g., Manna Gum, Swamp Gum, Blue Gum, and River Red Gum). Koalas use some other varieties of trees (e.g. Wattle) for shelter on hot days. Only one koala at a time will occupy a shelter tree. Whilst moving on the ground between trees, koalas are exposed to attacks from predators.

After bushfires in January 2020, several koala reserves were left devastated when forest habitat burnt leaving many koalas dead or injured and without sufficient food. The koala rescue team’s work is to inspect the reserves and provide help to the koalas. Unfortunately, the team operates within a restricted budget and sometimes has to make difficult decisions. The aim of the rescue team is to save as many koalas as possible within a limited budget.

The koala reserve consists of a series of observation points where the rescue team pauses, observes the koala population, the trees, and the predators, and decides how the koalas can be helped. The help may be to move a koala to a safe haven if it is injured or there is not enough food or shelter.

Koala Rescue Team simulation

The Koala Rescue Team simulation begins with a welcome message and an invitation to the rescue team leader to enter his/her name. The name cannot be blank but must be less than 16 alphabetic characters. The leader is then asked to enter the budget for the rescue. This is an amount from $100 to $200, inclusive.

The program then sets up the numbers of trees, koalas and predators in each of the 10 observation points as follows:

The numbers of trees in the reserve are read from a text file trees.txt. The numbers of each type of tree (Manna Gum, Swamp Gum, Blue Gum, River Red Gum, Wattle) at each observation point are read in from the file. The file has 10 lines, with 5 comma separated numbers on each line. Each line represents the tree numbers at each observation point. There is no other reading from the file during the actual running of the program.

Each tree is either used for shelter or food. Each shelter tree can hold a maximum of one koala. The food trees can produce a certain weight of leaves per day that can be eaten by the koalas (see Table 1 ). The weight is used to calculate the total food available for the koalas at any observation point. The food available is calculated by multiplying the number of each tree type by the weight of leaves it produces and summing these to get the total food available. Each koala, whether healthy or injured, can eat 1 kg of leaves per day.

Each koala will have a randomly allocated age of 1-18 years.

There is a random number of 0-4 predators at each observation point.

There are no koalas in safe haven at the start of the rescue.

The rescue team visits each of 10 observation points in turn. At each observation point the rescue team considers the number of trees, the number and condition of the koalas (some of which may be injured) and the number of predators. The team takes actions to help the koalas at each point. If the budget runs out at any point then the rescue mission continues but no actions can be taken that involve cost. The rescue mission is considered successful when all areas have been observed and all koalas have survived.

Class Design

Your program must consist of at least seven classes. A suggested class design is shown in

Important Notes

Your program must demonstrate your understanding of the object-oriented concepts and general programming constructs presented in FIT9131. Consider carefully your choice of classes, how they interact and the fields and methods of each class. You must use appropriate data structures to store the various objects (observation points, koalas, trees, etc.) in the program. You must make use of both Arrays and ArrayLists in your program. Make sure that you discuss your design with your tutor. You must document any additional assumptions you made.
You will be required to justify your design and the choice of any data structures used at the interview.
Validation of values for fields and local variables should be implemented where appropriate. You should not allow an object of a class to be set to an invalid state (i.e. put some simple validations in your mutator methods).
Your program should handle incorrect or invalid input and present the user with relevant error messages. No invalid input should crash the program.
Exception handling should be used where appropriate.

Interview

You will be asked to demonstrate your program at an “interview” following the submission date.

At the interview, you will be asked to explain your code/design, modify your code, and discuss your design decisions and alternatives. Marks will not be awarded for any section of code/design/functionality that you cannot explain satisfactorily (the marker may also delete excessive in-code comments before you are asked to explain that code).

In other words, you will be assessed on your understanding of the code, and not on the actual code itself.

The interviews will be organised during week 12 and will take place online via Zoom or other video facility after that time. You must have audio and video available and operating during the interview. It is your responsibility to make yourself available for an interview time and ensure that you have the audio and video capabilities. Any student who does not attend an interview will receive a mark of 0 for the request.