I'm almost done with my assignment but i have a small problem. I need to calculate the value for Class Standing "CS" here's my three classes.
The only problem is when i run the Outcome, the output for Class Standing is 0 what should i add to my script? thanks
Java Code
public class Outcome { public static void main(String[]args) { Student s=new Student(); grade g=new grade(); s.setQuiz(1); s.setAssignment(2); s.setMachineProblem(3); s.setSeatWork(4); s.setName("Charles"); s.setStudNumber(510180); s.setYrLevel(1); System.out.println("Name: "+s.Name); System.out.println("Year Level: "+s.YrLevel); System.out.println("Stud Num: "+s.StudNumber); System.out.print("Class Standing: "+g.CS); } }
Java Code
public class grade { double CS; public void CS(double Quiz, double Assignment, double SeatWork, double MachineProblem) { CS=(Quiz+Assignment+SeatWork+MachineProblem); } public double getCS() { return CS; } }
Java Code
public class Student { String classword2; String Name,Course; int StudNumber,YrLevel; double Quiz,Assignment,SeatWork,MachineProblem,ExamGrade; public void setName(String inputword1) { Name=inputword1; } public String getName() { return Name; } public void setStudNumber(int inputword2) { StudNumber=inputword2; } public int getStudNumber() { return StudNumber; } public void setYrLevel(int inputword3) { YrLevel=inputword3; } public int getYrLevel() { return YrLevel; } public void setCourse(String inputword4) { Course=inputword4; } public String getCourse() { return Course; } public void setQuiz(double inputword4) { Quiz=inputword4; } public double getQuiz() { return Quiz; } public void setAssignment(double inputword6) { Assignment=inputword6; } public double getAssignment() { return Assignment; } public void setSeatWork(double inputword7) { SeatWork=inputword7; } public double getSeatWork() { return SeatWork; } public void setMachineProblem(double inputword8) { MachineProblem=inputword8; } public double getMachineProblem() { return MachineProblem; } public void setExamGrade(double inputword9) { ExamGrade=inputword9; } public double getExamGrade() { return ExamGrade; } }