Okay, so I'm in java Object Oriented Programming and I'm stuck on one little thing on a project.
I have to create a class that holds a student name, calculates the total score and calculates the average score. But what's holding me up is that I need to create an object, that is called by the name that is given to me from input from the scanner.
I also am not 100% sure how to get the information from the program to the class, I think I just put them in the variable name from the name, but if I'm wrong, please tell me.
What I have so far is:
public class Prog2 { public static void main(String[] args) {
Scanner input = new Scanner (System.in);
Student name = new Student();
System.out.println("Please enter the name of the student.");
String theName = input.nextLine();
name.setName(theName);
System.out.println();
System.out.printf("Name of the object is", name.getName());
}
}
Right now I want to see I I can get the name in there. I also need to name the project the same name as the name that's given to me.