I'm aware I have posted several questions within the last 30 minutes and I do apologize for that. I'm just trying to learn this and grasp the concept of it. Now in this following class, I have five subjects with scores initizliaed to 40. I have one method that takes in arguments from the user. The other method that's a returning type returns the score. Rather, then having to writeandpublic int Pe Score() {return pe;}and same for the other 3 subjects. Is there another effiecnte way to write this, because writing this five times doesn't seem to be a smart method..i was just thinking of using a void and printint all of them out...public int sciencescore(){return science;}
public class StudentScore { private int math; private int science; private int calc; private int history; private int pe; //Make a constructor public StudentScore() { math=40; science=40; calc=40; history=40; pe=40; } public void getscore(int m_score,int s_score,int c_score,int h_score,int P_score) { math=m_score; science=s_score; calc=c_score; history=h_score; pe=P_score; } public int Scores() { return math; } public int scienceScore() { return science; } }