Write a class encapsualting the concept of a course grade, assuming a course grade
* has the following attributes: a course name and a letter grade. Include a constructor,
* the accessor and mutator, and methods toString and equals.Write a client class
* to test all the methods in your class.

Here is my code with all the methods except a client class to test all the methods in the class.
Not sure how to writes the code for it not many tutorials on the subject. Any help is apperiated.

package labmodule7num57;
import java.util.*;

public class LabModule7Num57 {
// Constructors//
private String name;
private String letterGrade;
public LabModule7Num57 (String name,String letterGrade) {

this.name = name;
this.name =letterGrade;

// Setting the name of course //
public void setName(String name) {

this.name = name;

//Setting the lettergrade of course//
public void setletterGrade(String letterGrade){
// Getting the name of the course//
public String getName() {

return name;
// Getting the name of the letter grade//
public String getletterGrade() {

return letterGrade;
// Returning the name of the course and the letter grade//
public String toString() {

return name+":"+letterGrade;

public boolean equals(Object obj){
if (!(obj instanceof LabModule7Num57))
return false;
LabModule7Num57 entry = (LabModule7Num57)obj;
return this.name.equals(entry.name) &&
public int hashCode(){
int hash = 37;
hash = hash*17 + this.name.hashCode();
hash = hash*17 + this.letterGrade.hashCode();
return hash;

public static void main(String[] args) {