
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
thumb_up100%
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
![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](https://content.bartleby.com/qna-images/question/a4bd34a9-cad0-4bb6-9739-21da21649a7b/62216c9f-2d47-4c7c-8f2c-3ce854d094c7/ediy2iw_thumbnail.jpeg)
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 3 images

Knowledge Booster
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
- An object’s attributes indicate the tasks that the object can perform. True or False?arrow_forwardInstructions Complete the following tasks: Use the Class Wizard in Visual Studio to create a class called Student. (Note that the Class Wizard will automatically create the .h and .cpp files.) Your Student class should have the following class members/properties: studentID, firstName, lastName, and studentStatus. (Note that the studentStatus member will be of type Status, which is an enum you will create.) Create a default constructor and a constructor that requires only the Student Id, first name, and last name. (The studentStatus member should not be initialized at this time.) Create a member function called getStudentInfo() that returns a string that contains the students first name, last name, and their status. Create a destructor for the Student class. (Note that the Class Wizard automatically includes a destructor.) Add a status.h file to the solution. Then add a Status enumeration to that file with the following entries: Attending, NonAttending, and Graduated. Then include this…arrow_forwardHelp me With this Java Taskarrow_forward
- CLASS NAME List the instance variables in the constructor. List the methods in the class. - indicates private CLASS NAME List the instance variables in the constructor. List the methods in the class. The second row of the UML diagram lists the instance variables in the constructor. For example -name: string o o name is the variable name o string is the data type of name + indicates public o getName is the method name o o string is the return data type Java.util. The third row of the diagram lists the methods in the class. For example, +getName(): string empty parenthesie indicate nothing is sent to the method.arrow_forwardActivity name: activity_main.xmlJava File: MainActivity.javaWrite the code needed to initialize binding variable in OnCreate method in MainActivity.java file.arrow_forwardAttributes item_name (string) item_price (int) item_quantity (int) Default constructor Initializes item's name="none", item's price = 0, item's quantity=0 Method print_item_cost() Ex of print_item_cost() output: Bottled Water 10 @ $1 = $10 in the main section of your code, prompt the user for two items and create two objects of the ItemToPurchase class. Exc Item 1 Enter the item name: Chocolate Chips Enter the item price: 3 Enter the item quantity: 1 Item 2 Enter the item name: Bottled Water Enter the item price: 1 Enter the item quantity: 10 Add the costs of the two items together and output the total cost Ex TOTAL COST Chocolate Chips 1 @ $3-$3 Bottled Water 10 @ $1= $10 Total: $13arrow_forward
- For c++. Need help designing class, no namespsace. FoodWastageRecord NOTE: You need to design this class. It represents each food wastage entry recorded by the user through the form on the webpage (frontend). If you notice the form on the webpage, you’ll see that each FoodWastageRecord will have the following as the data members aka member variables. Date (as string) Meal (as string) Food name (as string) Quantity in ounces (as double) Wastage reason (as string) Disposal mechanism (as string) Cost (as double) Each member variable comes with its accessor/mutator functions. --------------------------------------------------------------------------------- FoodWastageReport NOTE: You need to design this class. It represents the report generated on the basis of the records entered by the user. This class will be constructed with all the records entered by the user as a parameter. It will then apply the logic to go over all the records and compute the following: Names of most commonly…arrow_forwardmming assignment. To upload and submit the program and materials you created, select your saved documents. Make sure that the files are saved with your last name in the file name (Example: ch4_ca COSTUME SHOP 68. Create a requirements document and a Use Case Definition document and then design a Windows Form mock-up based c 1 C # 3 E D costume rental specials are as follows: A costume shop requests a computer application that advertises costume rentals. This week's $ 4 R Destination Renaissance Fair Write an application that allows the user to select any of the five costume rental specials. When the user selects a costume, the corresponding cost and a picture of the costume should be displayed. Clear each prior price and picture when the user selects a different costume. After selecting a costume, the user should be able to book the costume rental and then exit the window. F Stormtrooper Batman/Batgirl Pirate Q Search Bing do L % 5 T G 6 MacBook Pro Y FIGURE 2-68 Price $40 week rental…arrow_forwardPlease help using Javaarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education