Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Task 1

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 aft.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 Process Scores, 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 season
- highest 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 criteria and presentation below).

Task 2
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 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 criteria and presentation below).

Rationale
This assignment has been designed to allow students to test and demonstrate their ability to:
- interpret 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 5);
- apply basic testing and debugging techniques in program development (learning outcome 6);
- implement algorithms in Java (learning outcome 1);

Java, Programming

  • Category:- Java
  • Reference No.:- M92796473
  • Price:- $70

Guranteed 36 Hours Delivery, In Price:- $70

Have any Question?


Related Questions in Java

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As