2023 Task 1 Value 10 marks For this task you will create a class containing a number | Assignment Collections

Computer Science 2023 Java programming help

2023 Task 1 Value 10 marks For this task you will create a class containing a number | Assignment Collections

Task 1

 

Value: 10 marks

 

 

 

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 maxmin 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. Your textbook contains a description of how these can be calculated.
  •  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 85; for grade B, it is 75; for grade C, it is 65; for grade D, it is 50; and E 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. ThegradeDistn 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 E.
 
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. 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: 125
E: 35

 

 

 

 

 

Material to submit

 

The material to submit for each task is described in the section Assessment Information in this Subject Outline, under the heading Presentation.

 

 

 

Task 2

 

Value: 10 marks
 
For this task you will create a Point3D class to represent a point that has coordinates in three dimensions labeled xy and z. You will then use the class to perform some calculations on an array of these points.
 
The Point3D class will have the following state and functionality:
  • Three fields, xy and z, of type double, represent the point’s coordinates.
  • A no-arg constructor creates a point at position (0, 0, 0).
  • Another constructor creates a point with specified coordinates.
  • A getter method is provided for each of the fields.
  • An accessor method named distance returns the distance between the current point and another point passed as an argument.
  • The distance method is overloaded to accept the coordinates of the other point.
Write a TestPoint3D class that will have a main method, and perhaps other methods as required by good design, to test your Point3D class. It will not have user input because this class will stand as a record of the tests you have applied and you will be able to run it whenever you alter your Point3D class. The test class should contain the following:
  • Test the basic state and functionality of the Point3D class. Each of the constructors and each of the methods should be tested using some different data values. The test code should display values so that they can be checked.
  • Write some code to create an array of at least 10 Point3D objects.
  • Write a method max, which will accept the array of points as an argument, and will calculate and display the maximum distance between the points in the array, and the pair of points for which the maximum occurs.
  • Write a method min, which will accept the array of points as an argument, and will calculate and display the minimum distance between the points in the array, and the pair of points for which the minimum occurs.

 

 

 

 

 

Material to submit

 

The material to submit for each task is described in the section Assessment Information in this Subject Outline, under the heading Presentation.

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational