ITC538 | Designing Object Oriented Program | Java
Task
Assessment 2 has 20 marks in total. Marks will be scaled according to the value of the assessment.
There are two tasks in assessment 2, Task 1 and Task 2 as below:
Task 1: Value 10 marks
Suppose you are commissioned by the Australian Football Association (AFL) to write a program designed to produce statistics based on complete scores recorded in a season. These scores are kept in a file called afl.txt (available on interact resources). You are also given the following information about a football season:
League consists of 18 football teams
There are 22 rounds in each season
In each round teams play against each other and the score of each team is recorded as an integer and kept in the text file referred to above (aft.txt)
Your task is to write a complete java program (a java class with the main method) called ProcessScores, which will read the scores from the text file provided, store the scores in an array of integers and then using a number of independent static methods, calculate and display the required statistics relating the afl scores.
The java class you are required to author will contain the following static methods:
lowest will take the array of scores as an argument and return the lowest score in the seasonhighest will take the array of scores as an argument and return the highest score in the season
range will take the array of scores as an argument and return the difference between the highest score and the lowest score in the season
average will take the array of scores as an argument and return the average of all scores in the season
median will take the array of scores as an argument and return the median score in the season
mode will take the array of scores as an argument and return the mode of the scores in the season
Note that all of the methods described above, should be static methods; user defined methods (you have the write the definition of each yourself); and completely independent of each other (you should not invoke anyone of them within the other method definition). Also, the original array of scores should not be modified by any of the methods.
Ensure that the program is appropriately documented throughout and thoroughly tested to demonstrate its correct operation.
You need to submit java and class files, a short discussion to explain the logic on how the problem has been solved, and sample output (for detail please see marking guide and presentation below).
Task 2: Value 10 marks
Design a class named Light to represent a conference hall light. The class contains:
Three constants named LOW, MEDIUM, and HIGH with the values 1, 2, and 3 to denote Charles Sturt University Subject Outline the light brightness.
A private int data field named brightness that specifies the brightness of the light having a default value of LOW.
A private boolean data field named on that specifies whether the light is on or off having a default value of false.
A string data field named color that specifies the color of the light having a default value of red.
The accessor and mutator methods for all three data fields.
A no-arg/default constructor that creates a default light.
A method named toString() that returns a string description for the light. If the light is on, the method returns the fan brightness and color in one combined string. If the light is not on, the method returns the fan color along with the string “light is off” in one combined string. Draw the UML diagram for the class and then implement the class.
Write a test program TestLight that creates two Light objects. Assign high brightness, color yellow, and turn it on to the first object. Assign medium brightness, color blue, and turn it off to the second object. Display the objects by invoking their respective toString methods.
Ensure that the program is appropriately documented throughout and thoroughly tested to demonstrate its correct operation.
You need to submit java and class files, a short discussion to explain the logic on how the problem has been solved, UML diagram, and sample output (for detail please see marking guide and presentation below).
Rationale
This assignment has been designed to allow students to test and demonstrate their ability to:
- design and implement algorithms in Java (learning outcome 1);
- interpret and evaluate design requirements expressed in Unified Modelling Language (UML) (learning outcome 2);
- use object-oriented techniques and Java resources to develop small applications consisting of a number of classes (learning outcome 4);
- apply testing and debugging techniques in program development (learning outcome 5);
Marking criteria
Assessment 2 (Total Marks 20)
Task 1 (Total Marks 10)
Criteria | Marks | HD | DI | CR | PS | |
Program | ||||||
a. Execution: Program | executes | Provided java | Provided java | |||
perfectly | Provided java | |||||
launches, executes and | program executes | program may be | ||||
without | program executes | |||||
terminates without | 1.0 | without crashing | incomplete and/or | |||
crashing | without crashing | |||||
crashing; program executes | with minimal | executes with | ||||
towards | with some errors | |||||
as specified. | errors | some errors | ||||
intended | ||||||
output | ||||||
Implement | Implement | Implement | Implement |
and integrate | ProcessScores | ProcessScores class | ProcessScores |
classes with | class with most of | with majority of | class with some |
all functions | the functions and | the functions and | functions and |
Criteria | Marks | HD | DI | CR | PS | |
by | integrate the mark | integrate the mark | then combine it | |
maintaining | class with it for | class with it for | with Marks class | |
logical flow | testing | testing | for testing | |
Excellent | ||||
naming, | Good naming, | Most naming, | Some naming, | |
indentation, | indentation, | indentation, | ||
indentation, header | ||||
header and | header and inline | and inline | header and inline | |
inline | comments | comments | ||
comments included | ||||
comments | included | included | ||
included |
All of the | Most of the | Just enough of the | |||
required | Majority of the | ||||
d. Submission: the | required | required | |||
documents | required documents | ||||
documents with all | documents and | documents and | |||
components (analysis, | 1.0 | and sufficient | sufficient number | and sufficient | sufficient number |
testing, and output) | number of | of test outputs | number of test | of test outputs | |
test outputs | outputs provided | ||||
provided | provided | ||||
provided | |||||
Task 2 (Total Marks 10)
Criteria | Marks HD | DI | CR | PS | ||
Program | Provided java | |||||
a. Execution: Program | executes | Provided java | ||||
program | Provided java | |||||
launches, executes and | perfectly | program may be | ||||
executes | program executes | |||||
terminates without crashing; | 1.0 | without | incomplete and/or | |||
without | without crashing | |||||
program executes as | crashing | executes with | ||||
crashing with | with some errors | |||||
specified. | towards | some errors | ||||
minimal errors | ||||||
intended output |
Implement and | Implement and | Implement Light | Implement Light | ||
integrate all of | integrate most | and TestLight | and TestLight | ||
of the Light and | classes with | classes with some | |||
6.0 | the Light and | ||||
TestLight | majority functions | functions and | |||
TestLight | |||||
classes | and combine them | combine them for | |||
classes | |||||
functionaliies | for testing | testing | |||
UML with all | UML with most | UML with | UML with | ||
components | components and | majority | incomplete | ||
1.0 | and their | their parameter, | components and | components and | |
parameter, and | and return | their parameter, | their parameter, | ||
return | and return | and return | |||
All of the | Most of the | Majority of the | Just enough of the | ||
required | required | ||||
required | required | ||||
documents and | documents and | ||||
documents and | documents and | ||||
1.0 | sufficient | sufficient | |||
sufficient number | sufficient number | ||||
number of test | number of test | ||||
of test outputs | of test outputs | ||||
outputs | outputs | ||||
provided | provided | ||||
provided | provided | ||||
All of the | Most of the | Majority of the | Just enough of the | ||
required | required | ||||
required | required | ||||
documents and | documents and | ||||
documents and | documents and | ||||
1.0 | sufficient | sufficient | |||
sufficient number | sufficient number | ||||
number of test | number of test | ||||
of test outputs | of test outputs | ||||
outputs | outputs | ||||
provided | provided | ||||
provided | provided
visit at : ITC538 | Application of Programming in Java | Java
|