I have an array configured with students names, IDs, and grades, etc. I'm writing a method to pull the grades from the array, but I get this "boolean error" because I have a string. How do I correct it?
Here is the piece of code in question:
//code to print the students GPA based off the three grades received in class
public static void print_average_grade(String myStudentID)
{
for (Student variable : myStudent)
{
if (variable.getId() = (myStudentID)) //if statement is kicking back error....
{
double gpa = ((variable.getMyGradeA() + variable.getMyGradeB() + variable.getMyGradeC()) / 3);
System.out.println("Student with ID# " + myStudentID + " has a GPA of " + gpa);
}