-
Notifications
You must be signed in to change notification settings - Fork 0
/
Councellor.java
86 lines (80 loc) · 2.44 KB
/
Councellor.java
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import java.util.*;
import java.io.*;
class Councellor extends StudentDairy
{
Student student = new Student(); //another object created.
public void displayStudents() throws Exception //get data from the file.
{
BufferedReader r = new BufferedReader( new FileReader("Student.txt") );
String s = "", line = null;
while ((line = r.readLine()) != null) {
System.out.println(line);
}
}
public void addStudents() throws Exception //adding the students
{
//storing in the file.
BufferedWriter bw = new BufferedWriter(new FileWriter ("Student.txt",true));
Scanner s = new Scanner(System.in);
System.out.println("Input name");
String name = s.nextLine();
bw.write("\n");
bw.write("Name:"+name);
bw.write("\n");
System.out.println("Input place");
String place = s.nextLine();
bw.write("Place:"+place);
bw.write("\n");
System.out.println("Input Roll number");
int rollno = s.nextInt();
bw.write("Roll number:"+rollno);
bw.write("\n");
System.out.println("Input phone number");
String phn = s.next();
bw.write("Phone number:"+phn);
bw.write("\n");
// bw.newLine();
bw.close();
student.addedStudents(name,place,rollno,phn);
}
public void inputdetails() //inputting the details of a new students.
{
student.putdetails();
}
public void printdetails( int s_number) //getting the information of student.
{
student.getDetails(s_number);
}
public void viewBehaviour() //to view the behaviour of the student.
{
Scanner s = new Scanner(System.in);
System.out.println("Enter roll number of student");
int number=s.nextInt();
student.behaviour(number);
}
public void inputBehaviour() // to input the behaviour of the student.
{
Scanner s = new Scanner(System.in);
System.out.println("Enter roll number of student");
int number=s.nextInt();
System.out.println("Enter behaviour of "+number);
String sbehaviour = s. next();
student.updatebehaviour(number,sbehaviour);
}
public void viewDutyLeaves() //to view the number of duty leaves a student got.
{
Scanner s = new Scanner(System.in);
System.out.println("Enter roll number of student");
int number=s.nextInt();
student.viewdutyleave(number);
}
public void inputDutyLeaves() //to input the number of duty leaves for a student.
{
Scanner s = new Scanner(System.in);
System.out.println("Enter roll number of student");
int number=s.nextInt();
System.out.println("Enter number of duty leaves");
int numberdutyleaves = s. nextInt();
student.inputdutyleave(number,numberdutyleaves);
}
}