Design class named light to represent conference hall light

Assignment Help Computer Engineering
Reference no: EM131969021

Assignment

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 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 guide 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 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);

Reference no: EM131969021

Questions Cloud

What must be the roe of the firm : Eastern Electric currently pays a dividend of about $1.64 per share and sells for $27 a share. If its dividend growth rate is 5.9 %.
Determine the net present value of this asset : Assuming a tax rate of 39%, determine the net present value of this asset, if the company requires a 10% return on investments
Two recommendations that would improve the process : Using lean principles make two recommendations that would improve the process of (Long waits when customers are getting coffee at Starbucks.
Determine the accounting rate of return : Equipment is purchased at a cost of $39,000, the salvage value is $3,000. Determine the accounting rate of return
Design class named light to represent conference hall light : Design a class named Light to represent a conference hall light. Draw the UML diagram for the class and then implement the class.
Determine the relevant costs for this order : The assembly division of Davenport, Inc. is bidding on an order of 50,000 smart phones. Determine the relevant costs for this order for the assembly division
Determine the contribution margin in dollars : During the month, fixed costs were $16,800 and variable costs were 75% of sales. Determine the contribution margin in dollars, per unit and as a ratio
Prepare an income statement : Prepare an income statement, a statement of retained earnings and a balance sheet for this subsidiary in stickles
What is the market interest rate on janas debt : What is the market interest rate on Jana's debt, and what is the component cost of this debt for WACC purposes?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write a program that displays a checkerboard with 64 squares

Write a program that draws the side view of stair steps from the lower left to the upper right.

  Identify the role of it as a contributor to the business

respond to the followingidentify multiple business pressures on xerox.describe some of the companys response

  How many of packet should store order to maximize revenue

How many of each packet should the store order to maximize the revenue associated with information packets, and what is the store's expected revenue?

  List operation modes that can sped up by parallel processing

List the operation modes that can be sped up by parallel processing. List the operation modes that can be used for encipherment of random-access files.

  How to create an exit button

make a VB GUI program that tracks your employees and their previous work history. List your employees names in a drop down combo box. When the user selects a employee, display in a text area all of their previous work performed under code name Jam..

  The main reasons for it project failures

Statistics show that most projects fail for some reason or other. What are the key reasons for IT project failures?

  Write a program that displays all environment variables

Write a program that displays all environment variables. Write a program that sets an int variable x to 100 before forking a child.

  Write an if statement that uses a pseudorandom number

Write an if statement that uses a pseudorandom number to assign "heads" or "tails" to a variable coin_flip. The probability of each should be 0.5.

  How matlab spline tools can be used to compute cubic spline

Let S(z) be the natural spline interpolant of z3 at z = -3, z = -1, z = 1, z = 3. What is S(O)?

  What are some of the "old thinking" concerns about

Can you think of some disadvantages to telecommuting? What jobs will not be suitable for telecommuting.

  Design a team leader class that is derived from production

Design a Team Leader class that is derived from the Production Worker class you create in The Team Leader class should have properties for monthly bonus amount.

  What is the difference between radio buttons and check boxes

What is the difference between radio buttons and check boxes? Why do you need a button group for radio buttons but not for check boxes?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd