-2

I'll get right to it. I have an advisee class and my driver which calls from the advisee class.

My Advisee class pertaining to the error issue looks like this:

public String clearedToGraduateMessage(Advisee advisee1, Advisee advisee2,  
        Advisee advisee3, Advisee advisee4, Advisee advisee5)  
    {  
        if (graduationRequirements)  
        {    
            graduationMessage = ("\nYes - all requirements have been met");  
        }
        if (!graduationRequirements)
        {  
            graduationMessage = ("No - ");  
            if (getHoursCompleted() < 120)  
            {        
                graduationMessage += (" not enough hours;");  
            }
                else if (majorSheet == false)  
                {
                    graduationMessage += (" not completed major sheet;");
                }  
                else if (intentToGraduate == false)  
                {
                    graduationMessage += (" not filed intent to graduate");
                }  
            }  

        if (advisee1.metGraduationRequirements(advisee1, advisee2, advisee3, advisee4, advisee5)   
            == true)  
            advisee1.graduationMessage = ("\nYes - all requirements have been met");  
        else  
            {  
                advisee1.graduationMessage = ("No - ");  
                if (advisee1.hours < 120)  
                    advisee1.graduationMessage += (" not enough hours;");  
                else if (majorSheet == false)  
                    advisee1.graduationMessage += (" not completed major sheet;");  
                else if (intentToGraduate == false)  
                    advisee1.graduationMessage += (" not filed intent to graduate");  
            }

The "if(advisee1.metGraduationRequirements(advisee1, advisee2, advisee3, advisee4 advisee5) == true)" gets repeated 4 more times for their corresponding references, for the sake of not posting a ton of code I won't post that.

The driver looks like this:

case 4: //display all advisees that have been cleared to graduate  
                    strClearedToGraduateMessage = clearedToGraduateMessage(advisee1,   
                        advisee2, advisee3, advisee4, advisee5);

It's inside a switch statement, because I'm using a menu.

The "only" error that comes up when I try to compile is:

Proj4.java:142: error: cannot find symbol
                    strClearedToGraduateMessage = clearedToGraduateMessage(advisee1,   
                                                  ^
  symbol:   method clearedToGraduateMessage(Advisee,Advisee,Advisee,Advisee,Advisee)
  location: class Proj4
1 error

If anyone could help me out figuring out this error, it would be greatly appreciated. Thanks.

August
  • 12,410
  • 3
  • 35
  • 51
ChelseaH
  • 5
  • 5
  • The method clearedToGraduateMessage(), according to your question, is in the class Advisee. The error message tells that you're trying to call this method on an object of type Proj4. – JB Nizet Nov 15 '14 at 17:20
  • Paste additional code please from where exactly the clearedToGraduateMessage is called – SMA Nov 15 '14 at 17:20

1 Answers1

0

You have not shown all the relevant code, but it appears that in Proj4 (driver class), you have not created an instance of an Advisee object to reference. You need something like:

Advisee myAdvisee = new Advisee();
String result =  myAdvisee.clearedToGraduateMessage(...);

Unless your Advisee methods are static, you need to create the object you want to reference (Even if static, you still need to reference a class name).

I would recommend spending some time reading the The Java Tutorials/Classes

OldProgrammer
  • 12,050
  • 4
  • 24
  • 45
  • Thank you, I had created the instance earlier in the program called defaultAdvisee, but had forgotten reference it. – ChelseaH Nov 15 '14 at 18:00