please do in java firstname_lastname_assignment_6.zip ├── library │   └── docs │   └── StudentGrades.java Folder Structure Your project will contain three sub-directories: library test In the library directory, create the StudentGrades class. In the test directory, create the test application (Part 1).  StudentGrades Class Write a class encapsulating the concept of Student Grades. Use the class diagram above as well as the specific requirements below to develop your class: Class Members The attribute grades will store grades for students. StudentGrades(int) -  Initializes grades to a new array with the specified number of elements. The grade values are zero. StudentGrades(int[]) - Initializes grades to the specified array. Ensure that the reference to the grades is not accessible outside of the class. copyArray(int[]) : int[] - Returns a copy of the specified array. getGrades() : int[] - Returns a copy of the grades. setGrades(int[]) : void - Sets the grades. Ensure that the reference to the grades is not accessible outside of the class. getSortedGrades() : int[] - Returns a new array containing the values of the grades attribute sorted in ascending order. getHighestGrade() : int - Returns the value of the highest grade in the grades. getAverageOfGrades() : double - Returns the mean average of the values in the grades array. Formula: (grades[0] + grades[1] + …. grades[n]) / number of elements in array The toString will return a String representation of the class in the following format: toString Format =================== Student Grade =================== 1 {first element value} 2 {second element value} ... n {nth element value} Example =================== Student Grade =================== 1 79 2 54 ... n 82

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question
100%

please do in java

firstname_lastname_assignment_6.zip
├── library
│   └── docs
│   └── StudentGrades.java

Folder Structure

Your project will contain three sub-directories:

  1. library
  2. test

In the library directory, create the StudentGrades class. In the test directory, create the test application (Part 1). 

StudentGrades Class

Write a class encapsulating the concept of Student Grades. Use the class diagram above as well as the specific requirements below to develop your class:

Class Members

  • The attribute grades will store grades for students.
  • StudentGrades(int) -  Initializes grades to a new array with the specified number of elements. The grade values are zero.
  • StudentGrades(int[]) - Initializes grades to the specified array. Ensure that the reference to the grades is not accessible outside of the class.
  • copyArray(int[]) : int[] - Returns a copy of the specified array.
  • getGrades() : int[] - Returns a copy of the grades.
  • setGrades(int[]) : void - Sets the grades. Ensure that the reference to the grades is not accessible outside of the class.
  • getSortedGrades() : int[] - Returns a new array containing the values of the grades attribute sorted in ascending order.
  • getHighestGrade() : int - Returns the value of the highest grade in the grades.
  • getAverageOfGrades() : double - Returns the mean average of the values in the grades array.
    • Formula: (grades[0] + grades[1] + …. grades[n]) / number of elements in array
  • The toString will return a String representation of the class in the following format:

toString Format

===================
Student Grade
===================
1 {first element value}
2 {second element value}
...
n {nth element value}
Example
===================
Student Grade
===================
1 79 2 54
...
n 82
Class Diagram
Student Grades
-grades: int[]
+StudentGrades (numberOfStudents : int)
+StudentGrades (grades: int[])
-copyArray(toCopy: int[]): int[]
+getGrades() int[]
+ setGrades (grades int[]): void
+getSorted Grades(): int[]
+getHighestGrade(): int
+getAverageOfGrades(): double
+toString(): String
Transcribed Image Text:Class Diagram Student Grades -grades: int[] +StudentGrades (numberOfStudents : int) +StudentGrades (grades: int[]) -copyArray(toCopy: int[]): int[] +getGrades() int[] + setGrades (grades int[]): void +getSorted Grades(): int[] +getHighestGrade(): int +getAverageOfGrades(): double +toString(): String
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT