-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNightStudent.java
More file actions
31 lines (26 loc) · 899 Bytes
/
NightStudent.java
File metadata and controls
31 lines (26 loc) · 899 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
28
29
30
31
package unit_07.Examples.Example_06;
import java.util.Scanner;
public class NightStudent extends Student {
Scanner sc = new Scanner(System.in);
private long tuition;
public void getInfo() {
System.out.println("Enter Student's Name: ");
name = sc.nextLine();
System.out.println("Enter Student's ID: ");
studentId = sc.nextLong();
System.out.println("Enter Student's Grade: ");
grade = sc.nextFloat();
System.out.println("Enter Student's Tuition: ");
tuition = sc.nextLong();
sc.nextLine();
}
public void showInfo() {
System.out.print(studentId + "\t\t");
System.out.print(name.trim() + "\t\t");
System.out.print(grade + "\t\t");
System.out.print(tuition + "\n");
}
public void showTitle() {
System.out.println("\nID\t\tName\t\tGrade\t\tTuition");
}
}