Step 1 Getting Started Load your previous Studentjava file f
Solution
import java.util.*;
class Student
 {
     int studentID;
     String studentMajor;
     String firstName;
     String lastName;
     int studentCredits;
     int studentPoints;
     static int numOfStudents;
   
     public void setID(int id)
     {
         studentID=id;
     }
     public void setMajor(String major)
     {
         studentMajor=major;
     }
     public void setGradePoints(int points)
     {
         studentPoints=points;
     }
     public void setCredits(int credits)
     {
         studentCredits=credits;
     }
     public void setFirstName(String fName)
     {
         firstName=fName;
     }
     public void setLastName(String lName)
     {
         lastName=lName;
     }
   
     public int getID()
     {
         return studentID;
     }
     public String getMajor()
     {
         return studentMajor;
     }
     public int getGradePoints()
     {
        return studentPoints;
     }
     public int getCredits()
     {
         return studentCredits;
     }
     public String getFullName()
     {
         return firstName+\" \"+lastName;
     }
    public void increment()
     {
         numOfStudents++;
     }
   
 }  
     public class HelloWorld{
     public static void main(String []args){
        
          //variables to hold data collected form user
          String firstName,lastName,major;
          int id,credits,points;
          Student student1=new Student();
          Scanner read=new Scanner(System.in);
        
          //prompt the user to collect the details of student
          System.out.println(\"Enter first name\");
          firstName=read.next();
          System.out.println(\"Enter last name\");
          lastName=read.next();
          System.out.println(\"Enter student id\");
          id=read.nextInt();
          System.out.println(\"Enter student major\");
          major=read.next();
          System.out.println(\"Enter the number of credits entered by the student\");
          credits=read.nextInt();
          System.out.println(\"Enter student\'s number of points\");
          points=read.nextInt();
        
          //call setter of student class to set values
          student1.setFirstName(firstName);
          student1.setLastName(lastName);
          student1.setMajor(major);
          student1.setCredits(credits);
          student1.setGradePoints(points);
          student1.setID(id);
          student1.increment();
        
          //display student info.
        
          System.out.println(\"STUDENT INFORMTAION\ \");
          System.out.println(\"The name of student is :\"+student1.getFullName());
          System.out.println(\"The student id number is :\"+student1.getID());
          System.out.println(\"Major is :\"+student1.getMajor());
          System.out.println(\"The student\'s number of points is :\"+student1.getGradePoints());
          System.out.println(\"Number of earned credits is :\"+student1.getCredits());
        
          //call increment() on all objects
          Student student2=new Student();
          student2.increment();
          Student student3=new Student();
          student3.increment();
        
          //display numofStudent variable on different objects
          System.out.println(\"\ \");
          System.out.println(\"Student1: number of students= \"+student1.numOfStudents);
          System.out.println(\"Student2: number of students= \"+student2.numOfStudents);
          System.out.println(\"Student3: number of students= \"+student3.numOfStudents);
        
        
      }
 }



