rendered paste bodyE:\Java Class>javac StudentProcessor.java
.\Student.java:48: cannot find symbol
symbol : variable TotNumGP
location: class Student
GPA = (float)TotNumGP / (float)TotCredHrs;
^
.\Student.java:48: cannot find symbol
symbol : variable TotCredHrs
location: class Student
GPA = (float)TotNumGP / (float)TotCredHrs;
^
===========================================
public class Student
{
public int weight = 2;
private String m_StName;
private int m_StID = 99999;
private int m_TotCredHrs = 45;
private int m_TotNumGP = 100;
//
public void SetStName(String StName)
{
m_StName = StName;
}
public String getStName()
{
return m_StName;
}
//
public void setStudentID(int StID)
{
m_StID = StID;
}
public int getStudentID()
{
return m_StID;
}
//
public void setTotalCredHrs(int TotCredHrs)
{
m_TotCredHrs = TotCredHrs;
}
public int getTotalCredHrs()
{
return m_TotCredHrs ;
}
//
public void setTotalNumGradePoints(int TotNumGP)
{
m_TotNumGP = TotNumGP;
}
public int getTotalNumGradePoints()
{
return m_TotNumGP ;
}
//
public float GPACalc(float GPA)
{
GPA = (float)TotNumGP / (float)TotCredHrs;
return GPA;
}
public void display()
{
//GPACalc(GPA);//this is not correct
//String StrOut;
//StrOut = new GPACalc();
System.out.println("Student Name: " + m_StName);
//StrOut += (", ");
System.out.println("Student ID: " + m_StID);
//StrOut += (", ");
System.out.println("Total number of grade points: " + m_TotNumGP);
//StrOut += (", ");
System.out.println("Total Credit Hours: " + m_TotCredHrs);
//StrOut += (", ");
System.out.println("Student GPA: " + GPACalc());
//StrOut += (", ");
//return CalcedGPA;
float weightInstance;
weightInstance = weightedGrade();
System.out.println("Students weighted grade: " + weightInstance);
}
//
public float weightedGrade(int iIn)
{
float weightedGPA;
float GPA;
//weightedGPA = new GPACalc();
GPA = GPACalc();
weightedGPA = GPA + iIn;
return weightedGPA;
}
}