QuestionQuestion

• Create a Gradebook program:
o Create a gradebook class
o The data being stored in the class is the student's name, assignments (up to five assignments - use an array), and grade for each assignment. Note that each assignment can be a number (1) so a single array can be used for both assignments and grades.
o Make all attributes private.
o Include mutator and accessor methods as needed.
o Include a method to calculate the student's average.
o Include a method to display the gradebook:
- On the first line display the student's name.
- On the subsequent lines display each Assignment number and grade on a separate line.
- On the last line display the average.
- Include output messages explaining what is being displayed.
o Add a default constructor to initialize all variables and all elements of arrays.
o Do not include a main method in the Gradebook class.
o Create a test program for the gradebook class.
o Add a main method:
- Do not take any user input. Hard code all data.
- Create three objects of type gradebook.
- Add student names for each objects.
- Add grades for five assignments for each student.
- Call the display method for each object.
o Compile and run your program. Fix any errors.
o Submit your source code as a .java file(s). You may submit both classes in the same file or in separate files. Make sure your classes compile before submitting them.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

public class Gradebook {
    private String name;
    private double [] grades;

    /**
    * default constructor to initialize all variables and all elements of arrays.
    */
    public Gradebook() {
       this.name = "";
       this.grades = new double[5];
    }

    /**
    * accessor
    * @return array of grades
    */   
    public double[] getGrades() {
       return grades;
    }
   
    /**
    * accessor
    * @return name
    */
    public String getName() {
       return name;
    }...
$17.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats