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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education