Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

For this task you will create a class containing a number of static methods for processing an array of marks, which are scores in a test. Each mark is an integer in the range 0 to 100 inclusive. On the Interact site for this subject, you will be provided with a class Marks, which has a method getMarks that returns an array of marks for you to use in testing.

The class ProcessMarks that you create will have the methods specified below. Most will accept an array of marks as an argument; one will accept an array of characters. The return type should be appropriate for the returned value.
The max, min and range methods will return the maximum mark, the minimum mark and the difference between the maximum and minimum marks respectively.

The mean methods will return the mean of the set of marks.
The median method will return the median value of the set of marks. The median value is the middle one when the values are placed in order. To obtain an ordered version of the marks you may use an appropriate sort method of the Java API's Arrays class. Be careful not to destroy the original array of marks. If there is an even number of marks, the middle value is taken as the average of the two values that are nearest to the middle.

The mode method will return the mode of the set of marks, which is the most commonly occurring mark. To find the mode, use an ordered version of the set of marks, as used for finding the median. If there is more than one value that is most common, any one of the most common values will do for the mode.

The grades method will return an array of characters, which are the grades corresponding to the integer marks in the array of marks. The grades are to be assigned using the following lower boundaries for the corresponding marks: for grade A, the lower boundary is 90; for grade B, it is 75; for grade C, it is 60; for grade D, it is 50; for grade E, it is 45; and F is the grade for all other marks. A best solution for this method would not have the values for the lower boundaries hardcoded but would use an array for these values, which would allow the grade boundaries to be altered.

The gradeDistn method will accept an array of characters, which are the grades assigned for the array of marks, such as returned by the grades method. The gradeDistn method will return an array of integer values containing the distribution of grades, which is the number of occurrences of each grade in the assigned grades. The characters used for grades are fixed. The returned array should provide the distribution in order from grade A to grade F.

The following points should be taken into account in the design of your program:
None of your code should change the contents of the original array of marks.
You should not make any assumption that client code, that would use your methods, should call them in any particular order. That is, you should not assume that a client that calls the range method will have previously called the max and min methods.
Test your ProcessMarks class, either by providing test code in a main method within that class or in a separate class. The test code will use an array of marks obtained from the getMarks method of the Marks class provided on the Interact site. Test each one of the methods described above, displaying the results appropriately. The grades should be displayed 30 per line with a space separator between grades. The grade distribution should be displayed in the form:

A: 10
B: 30
C: 105
D: 75
E: 35
F: 10
Task 2
Value: 10 marks

For this task you have to define a class Circle2D to represent a circle with a point in two dimensions labeled x and y and a radius. To test Circle2D class you also need to define a test class. The Circle2D class has the following state and functionality:
Two double data fields named x and y that specify the centre of the circle with getter methods.
A data field radius with a getter method
A no-arg constructor that creates a default circle with (0, 0) for (x, y) and 3 for radius.
A constructor that constructs a circle with the specified x, y, and radius.
A method getArea() that returns the area of the circle
A method getPerimeter() that returns the perimeter of the circle
A method contains(double x, double y) that returns true if the specified point (x, y) is inside this circle
A method overlaps(Circle2D circle) that returns true if the specified circle overlaps with this circle.
Draw the UML diagram for the class and then implement the class. Write a test class program that creates a Circle2D object c1(new Circle2D(2, 2, 2.5)), display its areas and perimeter, and display the result of c1.contain(3,3), c1.containes(new Circle2D(4, 5, 8.5)), and c1.overlaps(new Circle2D(3, 5, 0.3)).
Rationale

This assignment has been designed to allow students to test and demonstrate their ability to:
to interpret design requirements expressed in Unified Modelling Language;use method abstraction in program design (objective 2);
to use object-oriented techniques and Java resources to develop small applications consisting of a number of classes (objective 5);
be able to apply basic testing and debugging techniques in program development
be able to implement basic algorithms in Java

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91605400

Have any Question?


Related Questions in Computer Engineering

A product is made up of three parts that act independently

A product is made up of three parts that act independently of each other. If any of the parts is defective, the product is defective. Part one is defective 5% of the time, part two is defective 10% of the time, and part ...

What does an income statement a balance sheet and a cash

What does an Income Statement, a Balance Sheet and a Cash Flow System intend to show about a company and how would you use the data contained within in making a credit determination?

Question describe specifically how the organization will

Question: Describe specifically how the organization will formulate a business performance plan, as follows: • Conduct a current situation analysis. • Determine the planning horizon. • Conduct an environmental scan. • Id ...

A new machine averages 4 clock cycles per instruction and

A new machine averages 4 clock cycles per instruction, and runs at a system clock of 20 MHz. The Axiom-Verge algorithm set to benchmark the system will take an even 3000 instructions to complete. a) Knowing how many cloc ...

Question suppose f is a function that returns the result of

Question : Suppose f is a function that returns the result of reversing the string of symbols given as its input, and g is a function that returns the concatenation of the two strings given as its input. If x is the stri ...

Create login form to enter user name and a password textbox

Create login form to enter user name and a password textbox to enter password, and write procedure to simulate the process of triggering the login process after hitting the Enter Key.

Once considered pure science fiction artificial

Once considered pure science fiction, artificial intelligence (AI) is being relied on more and more in today's world. Artificial intelligence deals with algorithms based on complex data sets. If you had to tell story rep ...

Small java programcreate an int called num and initialize

Small Java Program: Create an int called num and initialize it to 5000. Create an int called reps and initialize it to 0. Use a for loop control structure that runs if num is greater than or equal to 250, subtracting 139 ...

Please explain to me the concept of policing with emphasis

Please explain to me the concept of policing with emphasis on the "leaky bucket" mechanism

Question suppose we carry out a binary search of an ordered

Question : Suppose we carry out a binary search of an ordered list of 63 items: We are searching for an item X which occurs exactly once in the list. How many comparisons are carried out i. in the worst case scenario ii. ...

  • 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