Question: java Write a class called Student. The class has 3 Instance variables name - a String of the student's full name totalQuizScore - double numQuizesTaken

java

  1. Write a class called Student.
    1. The class has 3 Instance variables
      1. name - a String of the student's full name
      2. totalQuizScore - double
      3. numQuizesTaken - int
    2. Constructor
      1. Default constructor that sets the instance fields to a default value
      2. Parameterized constructor that sets the name instance field to a parameter value and set the other instance fields to a default value.
    3. Methods
      1. setName - sets or changes the student name by taking in a parameter
      2. getName - returns the name of the student
      3. getAverageScore - calculates and returns the average quiz score.
      4. addQuiz
        1. takes in a score parameter (int)
          1. If the score parameter is not within the range of a score (0 >= score <= 100) Display an error message and ignore that score.
          2. adds that score to totalQuizScore
          3. increments the numQuizesTaken field.
      5. getTotalQuizScore - returns the totalQuizScore .
  2. Write another class that will test our Student class called StudentTester
    1. Prompts the user for Student name(Hint: Scanner next() method)
    2. Creates a Student object with that name
    3. Create a loop that
      1. Asks user for a quiz score
      2. Adds that score to the Student object
      3. Ask the user if they are finished entering scores
    4. Use the methods of the class to print out the student's name, total score and average quiz score in a nicely formatted output where the score is rounded to 2 decimal place. (Hint use printf)
    5. Create new student object using the default constructor.
    6. Use the appropriate method to set the new Student object student name.
    7. Use the appropriate method to print out the new student's name.
  3. Include Javadoc for all classes, method and instance variables

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!