-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShowStudent.java
More file actions
27 lines (21 loc) · 971 Bytes
/
ShowStudent.java
File metadata and controls
27 lines (21 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import java.util.Scanner;/**
* ShowStudent
*/
public class ShowStudent {
public static void main(String[] args) {
Student student = new Student();
Scanner input = new Scanner(System.in);
String Id;
System.out.print("Set the student's ID: ");
Id=input.next();
student.setId(Id);
System.out.print("Set the student's number of credit hours earned: ");
student.setNumberCreditHours(input.nextFloat());
System.out.print("Set the student's number of points earned: ");
student.setPointsEarned(input.nextShort());
student.computeGradeAVG();
System.out.print("\n\nID: " + student.getId() + "\nNumber of hours earned: " +
student.getNumberCreditHours() + "\nNumber of points earned: " + student.getNumberPointsEarned() + "\nStudent's grade point average is: " + student.getGradePointAvg());
input.close();
}
}