you must implement public class Student by following the instructions as follows exactly. You may reference Chapter 7 for the similar examples to get the ideas and concepts.
Each student must have the following 5 attributes (i.e., instance variables):
You must declare the following 3 static variables with proper initial values:
private static int countStudents = 0 ; // count the total number of students being constructed
private static double totalGpa = 0.0 ; // total GPA sum of all students // don’t use float
private static double averageGpa = 0.0 ; // average GPA of all students // don’t use float
You must create one constructor, 5 accessors (getters), and 5 mutators (setters) for this Student class.
The constructor method Student must do all the following completely and properly:
totalGpa += gpa ; // add this student’s gpa to totalGpa
averageGpa = totalGpa / countStudents ; // computer current averageGpa
You must also create the following 2 static methods:
(a) toString – to form a student record properly as a string for printing;
(b) printStudentRecord – to print the student record in a nice format using toString method.
Therefore, at least 13 methods are to be created by you.
You must write a while loop asking the user to enter student id, last name, first name, GPA, and phone number. Then, you print the student record nicely, and show the current student count, total GPA, and average GPA. Then, continue asking the user to enter next student’s data. If the student id is 0 (i.e., zero), thank the user and stop your program nicely.
You must test your program (as follows) in your static void main method. Another optional way (if you know how) is to write a client class to test your program accordingly.
========================================================================.
Your complete testing input and output for this lab assignment must be as follows:
>> Please enter student id, last name, first name, GPA, and phone number>
1 Doe John 3.0 626-111-5428
Student id: 1, Last Name: Doe, First Name: John, GPA: 3.00, Phone Number: 626-111-5428
Current Student Count: 1, Total GPA: 3.00, Average GPA: 3.00
>> Please enter student id, last name, first name, GPA, and phone number>
2 Smith Mary 4.0 626-222-5555
Student id: 2, Last Name: Smith, First Name: Mary, GPA: 4.00, Phone Number: 626-222-5555
Current Student Count: 2, Total GPA: 7.00, Average GPA: 3.50
>> Please enter student id, last name, first name, GPA, and phone number>
3 Stone Joe 2.0 626-333-5555
Student id: 3, Last Name: Stone, First Name: Joe, GPA: 2.00, Phone Number: 626-333-5555
Current Student Count: 3, Total GPA: 9.00, Average GPA: 3.00
>> Please enter student id, last name, first name, GPA, and phone number>
4 Lin Steve 1.0 626-444-4444
Student id: 4, Last Name: Lin, First Name: Steve, GPA: 1.00, Phone Number: 626-444-4444
Current Student Count: 4, Total GPA: 10.00, Average GPA: 2.50
>> Please enter student id, last name, first name, GPA, and phone number>
5 Li Pete 3.0 626-555-6666
Student id: 5, Last Name: Li, First Name: Pete, GPA: 3.00, Phone Number: 626-555-6666
Current Student Count: 5, Total GPA: 13.00, Average GPA: 2.60
>> Please enter student id, last name, first name, GPA, and phone number>
6 Bee Scott 4.0 626-666-6666
Student id: 6, Last Name: Bee, First Name: Scott, GPA: 4.00, Phone Number: 626-666-6666
Current Student Count: 6, Total GPA: 17.00, Average GPA: 2.8333333
>> Please enter student id, last name, first name, GPA, and phone number>
7 Codd April 3.80 626-777-7777
Student id: 7, Last Name: Cod, First Name: April, GPA: 3.80, Phone Number: 626-777-7777
Current Student Count: 7, Total GPA: 20.80, Average GPA: 2.9714
>> Please enter student id, last name, first name, GPA, and phone number>
0 no 0.00 no
>> Thank you for using our Student program! See you later!
Thanks for posting the question, here is the complete class and output screenshot
thank you and do give a thumbs up !!
--------------------------------------------------------------------------------------------------------------------------------------------
import java.util.Scanner;
public class Student {
private String studentID;
private String lastName;
private String firstName;
private double gpa;
private String phoneNumber;
private static int countStudents = 0;
private static double totalGpa = 0.0;
private static double averageGpa = 0.0;
public Student(String studentID, String lastName, String firstName, double gpa, String phoneNumber) {
this.studentID = studentID;
this.lastName = lastName;
this.firstName = firstName;
this.gpa = gpa;
this.phoneNumber = phoneNumber;
countStudents++;
totalGpa += gpa;
averageGpa = totalGpa / countStudents;
}
public String getStudentID() {
return studentID;
}
public void setStudentID(String studentID) {
this.studentID = studentID;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public double getGpa() {
return gpa;
}
public void setGpa(double gpa) {
this.gpa = gpa;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
@Override
public String toString() {
return "Student id: " + getStudentID() +
", Last Name: " + getLastName() +
", First Name: " + getFirstName() +
", GPA: " + getGpa() +
", Phone Number: " + getPhoneNumber();
}
public void printStudentRecord() {
System.out.println(this);
System.out.println("Current Student Count: " + countStudents +
", Total GPA: " + String.format("%.2f",totalGpa) + ", Average GPA: " + String.format("%.2f",averageGpa)
);
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
for (int i = 1; i <= 7; i++) {
System.out.println("Please enter student id, last name, first name, GPA, and phone number>");
String[] data = scanner.nextLine().split("\\s+");
Student aStudent = new Student(data[0], data[1], data[2],
Double.parseDouble(data[3]), data[4]);
aStudent.printStudentRecord();
}
System.out.println("Thank you for using our Student program! See you later!");
}
}
--------------------------------------------------------------------

thanks !
you must implement public class Student by following the instructions as follows exactly. You may reference...
I need code in java
The Student class:
CODE IN JAVA:
Student.java file:
public class Student {
private String name;
private double gpa;
private int idNumber;
public Student() {
this.name = "";
this.gpa = 0;
this.idNumber = 0;
}
public Student(String name, double gpa, int
idNumber) {
this.name = name;
this.gpa = gpa;
this.idNumber = idNumber;
}
public Student(Student s)...
A) Please implement a Python script to define a student class with the following attributes (instance attributes): cwid: student’s CWID first_name : student’s first name last_name: student’s last name gender: student’s gender gpa: student’s gpa Please make these attributes as private ones so they have to be accessed via getter/setter methods or property. For this purpose, please define a getter/setter method and property for each of the attributes. Another thing you need to do is to define a constructor that...
(In Java) Implement a class named Student. For this exercise, a student has a name, an id number and a list of the quiz scores they have taken. Supply an appropriate constructor and methods getName(), getId(), addQuiz(int score), getTotalScore(), getNumQuizzes() and getAverageScore(). The scores should be stored in an array or ArrayList. You should compute the total score and the average score when needed. The id number should be implemented with the assistance of a static instance variable. The first...
Create an application that allows you to enter student data that consists of an ID number, first name, last name, and grade point average. Depending on whether the student’s grade point average is at least 2.0, output each record either to a file of students in good standing (located at StudentsGoodStanding.txt) or those on academic probation (located at StudentsAcademicProbation.txt).
Create an application that allows you to enter student data that consists of an ID number, first name, last name, and grade point average. Depending on whether the student’s grade point average is at least 2.0, output each record either to a file of students in good standing (located at StudentsGoodStanding.txt) or those on academic probation (located at StudentsAcademicProbation.txt). Enter ZZZ to Quit. This is in Java
2. Write a program named lab3 2.app that contains a class named Student to store student information Information that will be relevant to store is first name, last name, id number, GPA, and major (1) Define a member function named set0, which allows you to set all member variables. This function has an empty parameter list, and its return type is void. So, within the function you'll prompt for information. Note: For entering major, if you need a space, use...
java This lab is intended to give you practice creating a class with a constructor method, accessor methods, mutator methods, equals method , toString method and a equals method. In this lab you need to create two separate classes, one Student class and other Lab10 class. You need to define your instance variables, accessor methods, mutator methods, constructor, toString method and equals method in Student class. You need to create objects in Lab10 class which will have your main method...
Create a class hierarchy to be used in a university setting. The classes are as follows: The base class is Person. The class should have 3 data members: personID (integer), firstName(string), and lastName(string). The class should also have a static data member called nextID which is used to assign an ID number to each object created (personID). All data members must be private. Create the following member functions: o Accessor functions to allow access to first name and last name...
You will create a class to keep student's information: name, student ID, and grade. The program will have the following functionality: - The record is persistent, that is, the whole registry should be saved on file upon exiting the program, and after any major change. - The program should provide the option to create a new entry with a student's name, ID, and grade. - There should be an option to lookup a student from his student ID (this will...
Please help, provide source code in c++(photos attached)
develop a class called Student with the following protected
data:
name (string), id (string), units (int), gpa (double).
Public functions include:
default constructor, copy constructor, overloaded = operator,
destructor, read() to read data into it, print() to print its data,
get_name() which returns name and get_gpa() which returns the
gpa.
Derive a class called StuWorker (for student worker) from
Student with the following added data:
hours (int for hours assigned per week),...