Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Student Learning Outcomes. After completion of this lab, students will be able to write a Java program that: Creates a user designed class Reads input

Student Learning Outcomes. After completion of this lab, students will be able to write a Java program that:
Creates a user designed class
Reads input from the keyboard using a Scanner Object and its methods
Uses selection (if and if else) statements
Uses iteration (while, do while or for) statements
Display data to the user in a readable format
Follows standard acceptable programming practices.
Uses Javadoc commenting on all instance variables and methods
_________________________________________________________________________________________________
Write a class called Student.
The class has 3 Instance variables
name - a String of the student's full name
totalQuizScore - double
numQuizesTaken - int
Constructor
Default constructor that sets the instance fields to a default value
Parameterized constructor that sets the name instance field to a parameter value and set the other instance fields to a default value.
Methods
setName - sets or changes the student name by taking in a parameter
getName - returns the name of the student
getAverageScore - calculates and returns the average quiz score.
addQuiz
takes in a score parameter (int)
If the score parameter is not within the range of a score (0>= score <=100) Display an error message and ignore that score.
If the score parameter is within the range it adds that score to totalQuizScore
increments the numQuizesTaken field.
getTotalQuizScore - returns the totalQuizScore .
Write another class that will test our Student class called StudentTester
Prompts the user for Student name(Hint: Scanner next() method)
Creates a Student object with that name
Create a loop that
Asks user for a quiz score
Adds that score to the Student object
Ask the user if they are finished entering scores
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)
Create new student object using the default constructor.
Use the appropriate method to set the new Student object's student name.
Use the appropriate method to print out the new student's name.
Include Javadoc for all classes, method and instance variables
Follow the Minimum Coding Standards for this course.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions